Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Procedure or Function? Warning - lStupidQuestionFlag=.T.
Message
From
17/04/2000 08:16:34
 
 
To
17/04/2000 07:56:33
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00360281
Message ID:
00360298
Views:
13
>Or perhaps it's that traditionally a function returns a value, whilst a procedure does not.

Traditionally, that is the case. However, in VFP it doesn't make any difference how they are defined...it's how they are called. For example:


PROCEDURE MyRoutine
LPARAMETERS a, b
* Do something
RETURN "Completed"


Now, if I use the following code:


DO MyRoutine WITH 1, 2


It is treated as a procedure. The return value is not used. However, I can also call the same routine as a function:


c = MyRoutine(1, 2)
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform