Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to populate a listbox
Message
 
À
13/01/2006 18:46:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01086295
Message ID:
01087650
Vues:
13
>I had to add this into the forms LOAD for it to work, did you omit this by accident? (I'm the one who makes accidents around here :) )
>
>thisform.ADDPROPERTY("acontents[1]")

>
>Oops, sorry about that. When I said that you should add an array property to the form, I sort of assumed that you would go to the form menu and add it visually in the form designer.
>
>Just goes to show us once again that assume makes an a** of u and me < g >.
>
>PS, what do you mean by array scope?
>
>If you do not specifically declare your arrays and variable as public or local, they are private in scope by default. What this means is that they can be "seen" be the method in which they declared and in any method the is called by that method. When the method in which the variable or array is declared ( or, rather, not declared explicitly ) ends, the variable or array goes out of scope - poof! It is gone.
>
>When you make the array a property of the form, it can been "seen" by any form method or object (provided that you create it as a public property). It is a much better solution than declaring them as public.

I understand that part. Having used the ADIR() to populate thisform.my_array, it becomes a multimentional array. Anyhow, the "display memory" verifies that the array IS populated. The listbox gets populated with what looks like 13 blank items. However Suspending the form b4 the release, the 13 items appear with correct text. Can you advise on this phenomena?
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform