The nice thing about functions is that you can return the error code of your 
function
giving you the following syntax

IF myfunc(var1,var2,var3) THEN
   * process errors
END

which i prefer to 

CALL mysub(var1,var2,var3,error)
IF error THEN
   * process errors
END

and beware that parameters passed through to your function is still 
passed 'by reference' like in a subroutine, and not 'by value', so your 
function is 
able to alter all passed parameters
if you want to restrict your function from altering the passed parameters
you still need to enclose them in ()

best regards from 'grey rainy' Denmark

Jeff wrote this :

> Functionally speaking, why would I use a function which can 
> return a single 
> argument when I can use a subroutine which can return 1 or 
> more?  In terms of 
> code reuse, there are often times when I've written a 
> subroutine that returns 
> a single argument, only to go back months later and add more 
> return args.  A 
> subroutine would still need to be changed, but I feel the 
> perceived amount of 
> work I have to do is less.  
> 
> Perhaps it's just my perception...
> 
> -- 
> Jeff Butera, Ph.D.

Frie Funktionfrer - faglig organisation og tvfrfaglig a-kasse - www.f-f.dk

***************************************************************************************************************************************
Denne email og alle filer vedlagt som bilag kan indeholde fortroligt materiale, 
der kun er beregnet for adressaten,
og maa ikke udleveres eller kopieres til uvedkommende. Har De ved en 
fejltagelse modtaget denne email, bedes
De venligst omgaaende meddele os dette pr. telefon : 6313 8550. Paa forhaand 
tak.
***************************************************************************************************************************************
This email and any files transmitted with it may contain confidential 
information intended for the addressee(s) only.
The information is not to be surrendered or copied to unauthorised persons. If 
you have received this
communication in error, please notify us immediately by telephone: +45 6313 
8550. Thank you.
***************************************************************************************************************************************
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to