Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning 2 values from a form
Message
De
11/05/1999 17:45:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00217461
Message ID:
00217494
Vues:
25
>Very slick. Thanks.
>
>P.S. You should post this as a FAQ.


Done!

PS: Did you figure out Ken Levy's BuilderB yet?


>
>>Define your object programmatically.
>>
>>DEFINE CLASS parameterobject AS custom
>>MyNumVal = 0
>>MyCharVal = ''
>>MyArray[5] = .f.
>>ENDDEFINE
>>
>>*
>>* Populate the parameter object's properties
>>*
>>oParam = CREATEOBJECT('parameterobject')
>>oParam.MyNumVal = 5
>>oParam.MyCharVal = 'Test string'
>>oParam.MyArray[2] = DATE()
>>oParam.MyArray[5] = 'samples'
>>*
>>* Now call your form with the object
>>*
>>DO MyForm WITH oParam
>>
>>MyForm:Init
>>LPARAMETER tobject
>>thisform.PObject = tobject
>>
>>Other methods:
>>thisform.Pobject.MyNumVal = 100
>>etc...
>>
>>
>>Your form's init event declares it is receiving the parameter and updates the values as needed. These updates can take place anywhere in your form if your form has a property to store the reference. Now, when you get back from your form, the parameter object has the updated values and you can do whatever you need to with them. Kind of like global variables, only better!
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform