Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass parms to a form by reference with @
Message
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:
01490970
Vues:
86
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform