By default, parameters are passed by reference when called as a procedure, but by value when called as a function. You can change how paramters are passed to the function with SET UDFPARMS.
A function can return a value. If you don't specify one, it defaults to RETURN .T.
>I have several procedures in a .prg file that I call in various places in my form methods. And, I have "Set Procedure to WhatEver additive" in my app startup routine.
>
>So, when I want to use one of the procedures from a form or class method, I usually do something like this:
>
>
>Do SomeProcedure with lcSomeCharString1, lcSomeCharString, llSomeBoolValue
>
>
>I like the look of my code better if I do this:
>
>
>SomeProcedure(lcSomeCharString1, lcSomeCharString, llSomeBoolValue)
>
>
>It seems to work either way, so, are there any pros or cons to one way over another?
>
>.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer