Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running down a listbox
Message
De
25/03/2004 08:28:24
 
 
À
25/03/2004 06:46:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00889225
Message ID:
00889552
Vues:
21
Hi Marsha,

The code sample was provided to demonstrate a technique. This code could be enhanced to provide for any number of columns as follows:
lparameters tnColumn
local i, lcValue, lnColumn

if empty(tnColumn) or vartype(tnColumn) <> 'N'
  tnColumn = 1
endif
if not between(tnColumn,1,this.listbox.columncount)
  tnColumn = 1
endif

lcvalue = ''
for i = 1 to this.listbox.listcount
  lcValue = lcValue + this.listbox(i,tnColumn) + chr(13) + chr(10)
endfor
Glenn

>Hi Glen.
>
>This should work:
>
>local i, lcValue
>lcvalue = ''
>for i = 1 to this.listbox.listcount
>  lcValue = lcValue + this.listbox(i) + chr(13) + chr(10)
>endfor
>
>

>
>Only if the List Box's RowSource contains a single column < s >. If the RowSource has more than a single column and/or the BoundColumn is not column one, your code will break.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform