Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variables not releasing
Message
De
01/01/2000 18:40:48
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00311218
Message ID:
00311249
Vues:
42
Hi Ken,

>I'm filling arrays with fields from tables and using them in combos. The only way I can get it to work is (do I have to admit this) to initialize them in the load event as Public variables.

You can add custom properties to your form and use those, then there are know variables to release and you are using an OO solution. To create the propeties, in the FOrm Designer, click on Form>New Property and call it Field1 or the actualy name of the field (whatever).

THen instead of:

*Form.Load()
PUBLIC field1

Field1 = Mytable.Myfield1


you can do:

*Form.Load()
This.Field1 = Mytable.Myfield1


Then to access it in any form method or control method you can do:

?This.Field1

In your case, you need to make the property an array, no problem, just type in "Fields[1]" in the New Property Dialog Box.

Also. it sounds like you can use an SQL Select as the record source instead of arrays. I presume that your combo box shows current value in a field? Then you would set the Combo's RecordSourceType to SQL Select. and put "SELECT Field1 FROM Table1 GROUP BY Field1 INTO CURSOR cCombo1" in the RecordSource. If you still want to use a form property-array for the control source, you can still use the SELECT to populate it:

SELECT Field1 FROM Table1 GROUP BY Field1 INTO ARRAY Thisform.aFields

Does this help?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform