Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning value from Class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00158041
Message ID:
00158051
Vues:
20
Michael,

You have to store your return value to
a property, then access the property after
you are done with the form:

oForm = CREATEOBJECT("MyForm")
oForm.Show()

dDate = oForm.dReturnDate

RELEASE oForm


However, there are some gotcha's:

1. You cannot RELEASE the form, you must
HIDE it, then release it after you extract
the return value.

2. If the user closed the form via the "X",
the variable "oForm" will no longer hold a
reference to the form, so the above code needs
to have some validation:


oForm = CREATEOBJECT("MyForm")
oForm.Show()

IF TYPE("oForm") = "O" AND NOT ISNULL(oForm)
dDate = oForm.dReturnDate
RELEASE oForm
ENDIF

Hope this helps
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform