Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot quit VFP, why?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00565459
Message ID:
00565511
Views:
15
>Hi, don't know why, but i can't make this work.
>
>I have my login form with 2 buttons, OK and Cancel. If the user clicks on the Cancel button, the app have to finish, but I keep getting the message "Cannot quit Visual FoxPro".
>
>Here is the code placed on the click event of the Cancel button:
>
>
>ON SHUTDOWN
>SET SYSMENU TO
>CLOSE DATABASES ALL
>WAIT CLEAR
>RELEASE ALL EXTENDED
>CLEAR EVENTS
>QUIT
>
>
>please, help.
>
>Alonso

Hello Alonso,

Is your login form modal? After this form is released, the main program (or the calling program is going to continue. Modal forms do not use a 'READ EVENTS' command.

For example:
* pretend main program
do form loginForm    && loginForm is modal
read events          && this line is not necessary...and will not get executed
                     &&     until *after* the modal form has been released
It sounds like you want to go 2 possible directions based what the user does in this form. You might need something like this:
* pretend main program
do form loginForm to lSuccess
if lSuccess
    do mainMenu
    read events
else
    * end of main program...foxpro will quit here
endif
Use the unload method of loginForm to return a true or false value. I know I'm leaving out a lot of stuff that also goes in your main program.

HTH,
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform