Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initialize an empty array for a listbox
Message
De
31/03/2004 12:20:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/03/2004 12:16:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00890882
Message ID:
00891212
Vues:
25
>>>VFP 7, array is property of the form.
>>>
>>>I am trying update an application and want to create a list box which is populated by an array for a SQL select command. The first time it is used it is empty and it displays ".F." which make sense since there is nothing to display yet. The problems:
>>>
>>>1. not a good thing for users to see so I would like to display a blank line.
>>>2. I assume it is related to fact that there is no array, but if I try to add to the array I get an array out of bound message.
>>>
>>>What is the best way to avoid both problems.
>>>
>>>TIA for any help.
>>
>>thisform.myArray = ''
>>
>>But Claude,
>>Since your items would come from an SQL why no directly make RowSourcetype = 3 && SQL, and SQL itself as rowsource. It's a much flexible rowsourcetype IMHO than others like array, additem.
>>
>
>I want to add items to the end of the list as user adds data (4 values out of around 40) but did not want to have to execute the SQL query every time I need to add an item. I thought doing this via an array. So my approach is create the initial array at start up and then add items to the end of the array (I now equivalent of key field always increases). It work on my original test because I had data returned for the SQL querry but luckly died when developing when there is no existing data. If there is a better approach I am open to suggestions.
>>Cetin

IMHO SQL rowsourcetype is better approach. If they add you simply requery listbox.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform