Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_Screen object
Message
De
13/07/2000 17:51:32
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
 
 
À
13/07/2000 17:41:05
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00392079
Message ID:
00392097
Vues:
10
Hmmm... I guess I should have tested this first. It doesn't always seem to release all of the forms. It gets to a point where it runs into FRMMAIN, then it stops. I guess it must re-evaluate the object list with each iteration, and gets confused when objects are removed from the list?

>As you release each form, the Forms() array gets re-dimensioned and the forms get renumbered from 1 to FormCount. Therefore, at some point you will be attempting to access a form object that is outside of the Forms array.
>
>Try something like this:
>
>
>FOR EACH lo_Form IN _SCREEN.Forms
>   IF .NOT. UPPER(lo_Form.Name) == "FRMMAIN"
>      lo_Form.Release()
>   ENDIF
>ENDFOR
>
>
>>I'm trying to release all forms, other than the main form, when a button is clicked. They are not in a form set. The code works fine when the main form and one other form are open, but once I open more forms the code fails with a "FORMS is not an object error."
>>
>>For i=1 to _screen.formcount
>> If _screen.forms(i).name<>"frmMain"
>> _Screen.forms(i).release
>> Endif
>>Endfor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform