Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass parms to a form by reference with @
Message
 
À
29/11/2010 16:27:28
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows NT
Divers
Thread ID:
01490968
Message ID:
01490988
Vues:
54
>>>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform