Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variables passed by reference
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Variables passed by reference
Divers
Thread ID:
00360010
Message ID:
00360010
Vues:
50
Hi all,

I have a form class which is passed a local variable by reference in the init method. This variable specifies the value of a control on the form. I need to set the controlsource of the control to this reference or set the value of this variable when the form is released. Any ideas???

Bare-bones example:

LOCAL lcName
lcName = "John Q. Public"
loForm = CREATE("TestForm",@lcName)
loForm.SHOW()
?lcName && This has to be the value typed into the form

DEFINE CLASS TestForm AS Form
ADD OBJECT txt1 AS TextBox

PROCEDURE INIT
LPARAMETER p1

** THIS.txt1.CONTROLSOURCE = p1 && this doesn't work
** THIS.txt1.VALUE = p1 && sets value of control but user input does not change value of lcName

ENDPROC

PROCEDURE DESTROY

** lcName = THIS.txt1.VALUE && this obviously won't work - lcName needs to be local to the calling procedure

ENDPROC

ENDDEFINE
Brien R. Givens

Brampwood Systems
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform