Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Variables from Object to Form?
Message
De
20/03/1998 09:35:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00085886
Message ID:
00085970
Vues:
28
>How do I return a variable From an Object to a Form?
>I made a Class based on Form consist of one text box and a label.
>I called the Object from My Form by clicking a command button.
>Obj=CreateObject("MyClass")
>Obj.show
>After I retreive a text , I'd like to pass this value to the Form
>Behind.
>How do I work this out?
>Thanx in advance.
>
>Yong Seung Kim

A not-too-OOP way of doing it would be as follows:

In the code calling the form class:

PUBLIC gcTextValue
gcTextValue=""
Obj=CREATEOBJECT("MyClass")
Obj.Show
* Remember to release gcTextValue after use......

Within the QueryUnload method of the form class:

gcTextValue=THISFORM.txtBox.Value

Cheesy, but it'll work.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform