Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use array as rowsource in drop down list
Message
 
To
11/03/2002 09:27:50
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00630923
Message ID:
00630932
Views:
17
>Hi all,
>
>one of my drop down list (combol box) need to show information from a array named arrClass.
>My code:
>.rowsource='arrClass'
>.displayvalue=arrClass(0)
>..
>but the value cann't be displayed. Can someone please give me an example how to use array to display value in a drop down list?
>
>Linda

Hi Linda,

You should have something like that:
.rowsourcetype = 5
.rowsource = 'arrClass'
.Requery()
.Refresh()
.Listindex = 1 && if you want to show the first element in array
You cannot specify something like .displayvalue=arrClass(0) as arrays in VFP are not zero-based and always start with 1

Also, basically what is shown in combo depends on what your column Controlsource is and what that record value is. If the value is not in array the combo may just show nothing.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform