Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating form variables
Message
De
02/01/2001 09:02:20
 
 
À
01/01/2001 22:00:31
Les Chandra
Mastersoft Pty Ltd
Melbourne, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00458327
Message ID:
00458428
Vues:
14
Les - a quick question

1. When I click on the command button in the first form called from a program by 'do form form1 name 0123', I can access the properties by either o123.nameofproperty or thisform.nameofproperty.

2. When I click on the command button in the second form which was called by the first form with 'do form form2 name o124' I cannot read the properties by using 0124.nameofproperty, but only thisform.nameofproperty. However, I can still use o123.nameofproperty to access the properties of the first form

Why does being out of scope affect the second form and not the first form. I thought using 'do form xxx name oYYYY' allowed one to manipulate the form properties as a memory variable anywhere. It appears it does for the first form but not the second form.

Using your code in the "for loop", I can get the name of the form in the property sheet. Any idea how I can get the name of the variable assigned by the do statement.

Do you know if there any reason for any of theis or is that just the way it is?

Thanks

Gaylen











>>The first form calls the second form from a command button. "do form form1 name o124"
>>
>>I was using a command button on the second form to check its windowstate by using (o124.windowstate). At this point I would get the error that it couldn't find o124.
>
>
>Your variable has gone out of scope - o124 will go out of scope as soon as the click event has finished.
>
>As for the FORMS collection, you could try something like:
>
>FOR 1 = 1 TO _SCREEN.FormCount
> IF _SCREEN.Forms(i).Name = 'Form1'
>
> oForm = _SCREEN.Forms(i)
> nWindowState = oForm.WindowState
> ...
> EXIT
>
> ENDIF
>
>ENDFOR
>
>I am sure there are eleganter ways, but that should work.
>
>
>HTH
>
>Les
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform