Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass parms to a form by reference with @
Message
From
29/11/2010 16:13:41
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows NT
Miscellaneous
Thread ID:
01490968
Message ID:
01490970
Views:
85
>can I say do form myform with @parm1, @parm2 in vfp7

Yes, you put LPARAMETERS or PARAMETERS as the first statement in the .Init() method of the form. Another useful technique is to save the parameters to form properties (which you predefine), so they don't go out of scope when Init() ends e.g.
* MyForm.Init()

LPARAMETERS ;
  tuParm1 ;
  , tuParm2

This.MyProperty1 = tuParm1
This.MyProperty2 = tuParm2
UPDATE: by default, DO ... WITH ... passes variables by reference, I'm not sure what prefixing them with "@" will do. If you want to pass variables by value, you can use DO ... WITH (parm1), (parm2) (enclosed in parentheses).

Variables passed to UDFs are by value by default, unless you prefix them with "@".

Arrays should be passed by reference, or you only get the first element.

Objects are always passed by reference.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform