I could be wrong, but AFAIK a FUNCTION is just a SUBROUTINE with some
syntax magic (the DEFFUN statement) that lets you reference it in an
expression rather than using the CALL statement. A function call has the
same overhead as a subroutine call. You can't put local functions inside
of your program and get local variables that way (although you could do
that on the old ADDS MENTOR systems. I wish universe had included that
functionality)
The return from the function can be multi-valued, and you can change the
value of parameters just like in a subroutine call.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Wendy Smoak
> Sent: Wednesday, June 22, 2005 2:47 PM
> To: u2-users@listserver.u2ug.org
> Subject: [U2] Custom Functions
> 
> 
> I was just looking at the documentation for FUNCTION after 
> hearing a couple of people make reference to custom 
> functions.  How did we not know about this?!  (Has this 
> always been possible, or was it added
> recently?)
> 
> We consider subroutines fairly "expensive" in terms of system 
> resources, and tend to just use GOSUB within most programs.  
> But coming from the Java/OO world, the global variables are 
> *killing* me.  And I'm partial to the nested parenthesis 
> notation as well.
> 
> Does anyone have any best practice advice or gotchas to 
> impart?  We have a need to find the "Ultimate Parent" in a 
> tree of corporation/parent/subsidiary relationships.
> 
> In particular, I might find a case where there is more than 
> one "Ultimate Parent" and I need to signify an error.  Do I 
> return -1, or set @SYSTEM.RETURN.CODE to a positive number?  
> 
> Thanks,
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University, PA, IRM 
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to