Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form exiting using the exe
Message
From
11/09/2003 22:53:32
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
To
11/09/2003 21:00:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00828383
Message ID:
00828391
Views:
13
I'm guessing (since I don't use DO FORM) that your "main form" activates after your "log form", and since your log form is returning .T. (the default for Unload), then loClicked = .T., and therefore .Activate is releasing "main form".

(You can test loClicked yourself after your DO FORM).

Forms don't always unload the same way from the command windows as they do in an EXE due to the way things are scoped.

>why is it that when i run the project exe, and after i log in (frmlog) i get the message "Goodbye?" and exits my project?
>
>if i run this form in the command window, i don't get any error like that.
>
>
>i have this in my main form:
>
>***Activate
>IF loclicked
> MESSAGEBOX("Goodbye!",48,"BTR Daily Time Record")
> Thisform.Release()
> SET SYSMENU TO DEFAULT
>ENDIF
>
>
>***Destroy
>Application.Visible=.T.
>
>
>***Init
>PUBLIC lOclicked
>lOclicked=.F.
>
>Application.Visible=.F.
>_Screen.Visible=.F.
>DO mainmenu.mpr WITH THIS, .T.
>
>DO FORM log TO lOclicked
>
>
>***Keypress
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF nKeycode = 27
> nAnswer=MESSAGEBOX("Are you sure you want to exit?",292,"BTR Daily Time Record")
> DO CASE
> CASE nAnswer=6
> Thisform.Release()
> MESSAGEBOX("Goodbye!",48,"BTR Daily Time Record")
> ENDCASE
>ENDIF
>
>
>***Query Unload
>IF MESSAGEBOX("Goodbye!",48,"BTR Daily Time Record")==1
> Thisform.Release
>ENDIF
>NODEFAULT
>
>***Load
>Thisform.Show()
>
>
>
>i have this in my frmlog:
>
>
>***Init
>SET EXACT ON
>
>PUBLIC nUser
>nUser=""
>Thisform.txtUserId.SetFocus()
>
>***Keypress
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF nKeycode = 27
> lRet=.T.
> Thisform.Hide()
> Thisform.Release()
>ENDIF
>
>
>***Load
>Public lRet
>lRet=.F.
>
>
>
>any help pls?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform