General information
Category:
Forms & Form designer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only