Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 6 and the QUIT command
Message
De
08/12/1998 15:02:48
 
 
À
08/12/1998 14:52:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00165271
Message ID:
00165278
Vues:
12
Hi John ----

Try ON SHUTDOWN CLEAR EVENTS and after your READ EVENTS put your clean-up code. Warning, though, some _SCREEN and MODIFY WINDOW SCREEN commands will cause a C0000005 Exception error when the app is run as an EXE and those commands are after the READ EVENTS.

>The QUIT command doesn't work the same in VFP6 as in VFP5
>How do I exit apps gracefully using ON SHUTDOWN and QUIT.
>If users trial time expired upon login or while running a form
>in the system?
>
>Sample of my 'Test' Source:
>************************************************************
>***---| Main.prg && The startup procedure
>*housekeeping/setup not shown here
>LOCAL llLoginOkay
>
>***---| These two line are used in the actual application
>*ON ESCAPE DO EscTrap
>*ON SHUTDOWN goApp.OnShutdown && This issues the QUIT command
>
>***---| Call MainInit in another .prg file
>***---| which instantiates goApp excerpts shown below
>***---| PUPLIC goApp
>***---| goApp = CREATEOBJECT("xxxApp")
>
>DO FORM Login TO llLoginOkay
>
>***---| These line are used in the actual application
>*IF llLoginOkay
>* goApp.Show
>*ENDIF
>*RELEASE goApp
>
>************************************************************
>***---| Login.Init()
>***---| WindowType = 1-Modal
>LOCAL llSomething
>
>llSomething = .T.
>IF llSomething
> DO FORM form1 TO lnStatus
>
> IF lnStatus <= 0
> QUIT && Quit should automatically do a safe shutdown
> ELSE
> ***gnVar =
> ENDIF
>ENDIF
>thisform.Text1.SetFocus()
>
>************************************************************
>***---| Form1.Unload()
>***---| WindowType = 1-Modal
>
>* xxxBASEFORM::Unload() && no code in baseform's unload
>
>RETURN Thisform.RetValue && property default set to -1
>
>***---| Form1.Command1.Click() && The Cancel button
>Thisform.RetValue = -1
>Thisform.Release()
>************************************************************
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform