Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running down a listbox
Message
From
25/03/2004 08:28:24
 
 
To
25/03/2004 06:46:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00889225
Message ID:
00889552
Views:
20
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform