Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to a procedure in .PRG
Message
From
27/09/2005 14:44:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01053275
Message ID:
01053594
Views:
7
>Hi Mike,
>
>>
>>Name the PRG the name of the function (MyProcedure.PRG). Don't put a function or procedure line. Start with an LPARAMETERS line.
>>
>>Call the function with DO MyProcedure or with x=MyProcedure() and you save a line of code because you don't have to SET PROCEDURE TO. You also don't have to DO MyProcedure in MyProc.PRG. The MyProcedure.PRG must be in the path until compiled into an EXE or APP.
>>
>
>This is how I have it now, the procedure is the name of the .prg file. And you are right, it saves a line since I don't have to do SET PROCEDURE TO. Thank you for confirming that this is OK way to do it (I thought it would be "cleaner" to declare the procedure inside the .prg file).

It used to be slower if you included the PROCEDURE line in the separate .PRG. I don't think that's a problem anymore. Leaving it out allows you the flexibility to rename the .PRG (and hence the function) to a different name by merely renaming the file.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform