Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get returned value from a class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00025913
Message ID:
00025918
Vues:
33
>I made a kind of Form class which asks to
>confirm delete or not.
>There are two command buttons,
>-Yes and No, each returns .t. and .f. in the unload event.
>The Class name is YesorNo and I write some code like below,
>
>confirm_box=CreateObject('YesorNo')
>confirm_box.show()
>
>And I lost my way to take the returned value(.t. or .f.) from the Object.

add a property to your class called lReturnValue. in your buttons put the following

-- YES --
thisform.lReturnValue = .t.
thisform.hide

-- NO --
thisform.lReturnValue = .f.
thisform.hide

in your calling code,

llReturnedValue = confirm_box.lReturnValue
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform