Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering arrays...
Message
De
07/04/2004 04:44:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
06/04/2004 17:12:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00892752
Message ID:
00892833
Vues:
18
>Hi All:
>
>I'm using a 2 column array in a combobox, displaying only the first column but using the 2nd column as the filter type. Is there an easy way to only display the values in the 1st column that conform to those in the first?
>
>Thanks
>Luke

Lucien,
It'd be easier to control with an SQL rowsourcetype.
However for arrays since you're using only one column you might utilize NumberOfElements property. ie: Suppose you want to show only those with a value GTE text1.value (assuming 2nd col filter is sortable like where unit_price >= 100 or .t./.f. etc) :
Asort(Thisform.aElems,2,-1,1)
Local lnRow
For lnRow=1 To Alen(Thisform.aElems,1)
  If Thisform.aElems[m.lnRow,2] < Thisform.Text1.Value
    Exit
  Endif
Endfor
If lnRow > 1
  Thisform.combo1.NumberOfElements=m.lnRow-1
Else
  Messagebox('No match')
Endif
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
Répondre
Fil
Voir

Click here to load this message in the networking platform