Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ON SHUTDOWN/File - Exit
Message
De
10/02/1999 12:02:21
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00185955
Message ID:
00186045
Vues:
23
>>>I have this code in my File - Exit pad:
>>>
>>>LOCAL lnForm, lnFormToClose
>>>lnFormToClose = 1
>>>FOR lnForm = 1 TO _screen.FormCount
>>>  IF TYPE("_screen.Forms(lnFormToClose)") == "O"
>>>    IF _screen.Forms(lnFormToClose).QueryUnload()
>>>      _screen.Forms(lnFormToClose).Release()
>>>    ELSE
>>>      RETURN .F.
>>>    ENDIF
>>>  ELSE
>>>    lnFormToClose = lnFormToClose + 1
>>>  ENDIF
>>>ENDFOR
>>>CLEAR EVENTS
>>>DO cleanup
>>>
>>>...and Cleanup does CLOSE DATABASES, CLEAR ALL, SET CLASSLIB TO, and so forth.
>>>
>>>1) is this good ON SHUTDOWN code?
>>>2) should I be looping backwards from _SCREEN.FormCount to 1?
>>>
>>>I didn't include all my cleanup code because I know that my question is a bit vague anyway. I don't have an application object because it is a fairly simple modified legacy app.
>>
>>
>>You can remove some redundancy and correct as follows:
>>LOCAL lnForm, lnCount
>>lnCount = _screen.FormCount
>>FOR lnForm = 1 TO lnCount     && have to do this because formcount
>>                              && changes every time you close a form
>>  IF TYPE("_screen.Forms(lnForm)") == "O"  && might also test to see if
>>                                           && BASECLASS property is "FORM"
>>    IF _screen.Forms(lnForm).QueryUnload()
>>      _screen.Forms(lnForm).Release()
>>    ELSE
>>      RETURN .F.
>>    ENDIF
>>  ENDIF
>>ENDFOR
>>CLEAR EVENTS
>>DO cleanup
>
>Why does the code come out double-spaced when I copy-and-paste the original code into my reply?

It seems to be some sort of problem with the second use of a < PRE > tag. HTML handling "anomoly" with the UT I'm sure.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform