User-defined function

37 views
Skip to first unread message

fabricio venancio

unread,
Aug 8, 2013, 10:33:59 AM8/8/13
to
Hi friends

I saw in Uniface 9.4 library an user-defined function example:

entry MULTIPLY
returns numeric

params
numeric PAR1: IN
numeric PAR2: IN
endparams

variables
numeric MultiplyResult
endvariables

MultiplyResult = PAR1 * PAR2
return MultiplyResult
end

To use this function:

$1 = MULTIPLY(2, 4)
; $1 equals 8

Where can I write this function to use it in all of forms?

Library -> Global procs?

Thanks a lot


Fabricio Venancio
Uniface Developer
Florianópolis-SC - Brazil

Pépère

unread,
Aug 8, 2013, 6:00:19 PM8/8/13
to fabricio venancio
Hello Fabricio,

we don't use this in global procs, but it may be works.
We prefer use it in include proc, and it's working well.
Of course, we have to recompile all components if there are notable
changes, or some components in case of minor change, but not release the
.dol file; that's our choice.

for example:

;include-proc mybib:myincludeproc
entry MULTIPLY
returns numeric
params
numeric PAR1: IN
numeric PAR2: IN
endparams
variables
numeric MultiplyResult
endvariables

MultiplyResult = PAR1 * PAR2
return MultiplyResult

end MULTIPLY


;Local proc module of mycomponent
#include mybib:myincludeproc

entry dosomething
variables
numeric theResult
endvariables

theResult = MULTIPLY(3, 4); maybe twelve ?

end dosomething


Hope it's helping you,

Philippe.

Pépère

unread,
Aug 8, 2013, 6:00:19 PM8/8/13
to uniface...@lists.umanitoba.ca
Le 08/08/2013 16:33, fabricio venancio a écrit :
Hello Fabricio,

we don't use this in global procs, but it may be works.
We prefer use it in include proc, and it's working well.
Of course, we have to recompile all components if there are notable
changes, or some components in case of minor change, but not release the
.dol file; that's our choice.

for example:

;include-proc mybib:myincludeproc
entry MULTIPLY
returns numeric
params
numeric PAR1: IN
numeric PAR2: IN
endparams
variables
numeric MultiplyResult
endvariables

MultiplyResult = PAR1 * PAR2
return MultiplyResult

AyeJayUU

unread,
Sep 16, 2016, 7:05:20 AM9/16/16
to
Hi,
you could create it as a global proc for wide release and then use it as if it was an include proc for a limited release by using #entry in your component
e.g. #entry mylib:multiply

for a global proc called multiply in library mylib
#entry is un-documented though (at least as of 9.02.01)
Reply all
Reply to author
Forward
0 new messages