Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form return value
Message
From
07/08/2007 07:53:44
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01246371
Message ID:
01246430
Views:
80
Hello Naomi, thanks for the reply.

>I don't think you can return a value if you exit the form from the Init.

>Perhaps you can use a parameter object instead of regular parameters and return values through its properties?

That's worth thinking about, but whereas I can see how to implement that for class-based forms created using oForm = CREATEOBJECT('MyForm'), how does that work for .scx-based forms called using DO FORM MyForm WITH paramlist TO MyVariable?

Anyway, I've found a solution to my problem, which you and other readers might be interested in. It's not super-elegant, but it works.

As you say, it appears that you cannot return a value from form.init if the Init() return value is .F. (ie. form not instantiated), even though code-execution goes directly to the Unload() event, any return value is ignored. The trick is to not return .F. in form.Init(), but let the form proceed to the Activate() event, which contains code like this...
IF condition=quitformnow
thisform.release
ELSE
DODEFAULT()
ENDIF

Regards,
Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform