Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd behaviour with form return value
Message
From
11/03/2005 20:42:08
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Odd behaviour with form return value
Miscellaneous
Thread ID:
00995094
Message ID:
00995094
Views:
57
Here's an odd one which I cannot explain...


I need to store a form's return value to a variable, which I do using the following code...

LOCAL lnFormValue
lnFormValue = .NULL.
DO MyForm TO lnFormValue && MyForm is a modal form

If I close the form by clicking on the cross in the top-right of the window, everything works ok and I end-up with the expected value for lnFormValue. However, if I close the form via a toolbar button, the resulting value of lnFormValue is still .NULL., and the form value is lost.

The close button Click() code is...
LOCAL loForm
loForm = _screen.activeform && form object reference

IF loForm.QueryUnload()
loForm.Release()
ENDIF

The Form.Unload() code contains
RETURN thisform.returnvalue
and I have checked that this code is being executed before control returns to the calling procedure.

Has anyone any idea how I can get my return value when closing the form via. a toolbar button? Any help would be appreciated.

Alan
Next
Reply
Map
View

Click here to load this message in the networking platform