Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning value from Class
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00158041
Message ID:
00158051
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform