Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function vs Procedure
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671285
Message ID:
00675630
Views:
8
>Jim
>What is the difference in behavior: Is it a fuction has to return to caller while a procedure can thread-on-out with out returning?
>Terry
>

Terry,

No that is not the case, either can call out to other code, the difference is simply this;
A Procedure

Called with DO ... 
Parameters passed by DO ... WITH < Parm1 >, < parm2 >, ...

Parameters are passed by reference (by default)

Does not return any value
A function

Called with FunctionName()

Parameters passed by FunctionName(< Parm1 >, < parm2 >, ...)

Parameters are passed by value (by default). The default passing can be altered with SET UDFPARAMS command

Can return a value
There are no other unique qualities of either. What makes a routine either a procedure or a function is HOW YOU CALL IT. If you DO it it is a procedure and if you use function syntax to call it it is a function.
Previous
Reply
Map
View

Click here to load this message in the networking platform