General information
Category:
Forms & Form designer
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
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