Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
VFP 6 and the QUIT command
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()
************************************************************
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement