Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass parms to a form by reference with @
Message
 
To
29/11/2010 16:27:28
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:
01490988
Views:
53
>>>>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
>>>
>>
>>Al,
>>
>>Thanks for the reply. That's what I thought too, and I have the form setup just as you described. However, a line just like that is giving me a syntax error in vfp7 and vfp9
>>
>>
>>*.test\junktest
>>
>>PRIVATE parm1, parm2
>>parm1=1
>>parm2=2
>>
>>DO FORM junkform WITH @parm1, @parm2
>>
>>
>>syntax error
>
>I updated my reply before you posted yours, basically you don't need the "@"s in your command, DO ... WITH ... passes variables by reference by default without needing them. So just,
>
>DO FORM junkform WITH parm1, parm2
>
Al,

Repeating my post to Sergey,

I saw that removing the @ removed the error, but I thought I had to have them, so I thought it must be something else in the way the call was made that I was overlooking.

Thanks again.
Previous
Reply
Map
View

Click here to load this message in the networking platform