Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List Box Problems
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00928838
Message ID:
00929276
Vues:
19
>Thanks for your help! The local issue was the problem…not discussed very well in the VFP reference. I had thought all variables declared in a form were visible to that form wherever they were declared. Now I’ll be much more careful.
>A beginner with VFP, I’m not yet comfortable with creating my own objects, properties or classes (have done so with form controls though).
>Anyway, I solved the problem as follows and would appreciate a critique if I have done something not appropriate.
>In the Load portion of the form containing the listbox:
> Open Database stkmktdat
> Public gadbtbls(1)
>In the Release portion of the form:
> Close Databases
> Release gadbtbls(1)
>In the Listbox of the form:
> RowSource = gadbtbls
> RowSourceType = 5-Array
>The result provides me with only those files in the database which I want to mark for updating.
>Thanks again!

You're welcome!

I don't see any problems with this approach syntactically. Though, couple cautions might be taken: one is that when you declare public variables, you have to make sure the same variable is not declared else where, otherwise an error would result which may not be detectable at design time. The other is when you issue close databases you are closing the currently set database. If the currently set database is not intented one, then you are closing the wrong one.

I would recommend you to use a property of the listbox or the form as the row source of the listbox instead of a public variable. Clearly, the scope of the public variable that you declared here is really the scope of the form, then you don't have be concerned about this public variable conflict. Besides, this fits better with OOP (Object-Oriented Programming).
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform