Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Procedure canceled message when quiting runtime prog
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00897027
Message ID:
00897458
Vues:
23
Sorin,

IMHO there is no reason to use quit within production code in the runtime environment which is where Dennis was seeing the cancelled wait window.

A main.prg can be as simple as this code fragment, my actual one isn't much more complicated.
* main.prg
on error ... && establish an error handler in case there are any errors that occur outside the control of objects
on shutdown EndApp()

StartApp()

do mymenu.mpr
read events

EndApp()
return && goes back to command window at devtime and back to the O/S at runtime

function StartApp()
* setup however you need
return

function EndApp()
on shutdown
clear events && in case app is shutdown outside using the File/Exit menu
* have your forms manager close any open forms
close data all && just in case there's code that's not properly closed tables
* clean up however else you need
return
Cannot quit Foxpro is caused by not having an ON SHUTDOWN handler in place with a READ EVENTS still active.

The "problem" with the help file is this statement (from VFP8, although 6 and 7 have similar admonishments)

Always use QUIT to terminate a Visual FoxPro session...

is patently not true.

>I don't know if it's the simplest for Dennis to avoid using QUIT, it may be, however I think QUIT has its value. My approach is to have a Cleanup() function/method execute ON SHUTDOWN, which Cleanup ends in a QUIT. This avoids having the user face a message like "Cannot quit VFP" when shutting down Windows with the VFP app still open. With something like ON SHUTDOWN Do Cleanup.prg this will not happen.
>Yes, QUITing while testing in development sucks. However, for the development, I would call the same Cleanup upon exiting the app, which evaluates the VFP version and if in development, it would RETURN after cleaning-up and resetting the environment.
>
>Sure, if QUIT bothers you then don't use it, but I still have to develop as if QUIT would happen anywhere during the app runtime. Maybe the message here should be stop using QUIT improperly :), but do use it in runtime. And BTW, I don't see anything wrong with the help file on QUIT.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform