Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Select From Array
Message
From
09/08/2000 13:11:13
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
09/08/2000 10:23:36
Julie Ball
Gardner Publications, Inc.
Cincinnati, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00402784
Message ID:
00402888
Views:
9
FoxPro 2 doesn't support multiple select lists natively. As I remember, even if you define the list FROM POPUP and set MULTISELECT in the popup the listbox will not support it.

Here is how I got around it. I chose a character to indicate the list item was selected and appended it to the item in the array.
Here is the code - assuming:
nValue = Numeric value of list box
cMark = The character which indicates the list item is selected
aList = array of list items
NOTE-Define the array so the first character of each list item is a space.

Toggle the selection in the valid clause:
IF LEFT(aList(nValue),1) = cMark
    aList(nValue) = ' ' + SUBSTR(aList(nValue),2)
ELSE
    aList(nValue) = cMark + SUBSTR(aList(nValue),2)
ENDIF
To determine which items were selected, loop through aList looking for rows with cMark as the first character.
If you are using a proportional font in FoxPro for Windows, you may want to pad the list items with two spaces to make things line up better and change the VALID code accordingly.


>I have a screen that displays an array in a list box. How do I set the list box up to allow user to select more than one?
David.
Previous
Reply
Map
View

Click here to load this message in the networking platform