Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Listbox question

Status
Not open for further replies.

ShortyII

Programmer
Sep 8, 2003
57
0
0
NL
Hello i have a listbox that is based on a array.
But the array is two dimensional.
When is say myArray i get the first dimension to see in the listbox but i want to see the second dimension.

How can i specify to display the second dimension of my array.

Thanx
 
You're talking about FoxPro 2.6 for DOS / Windows, not VFP here ?

You can't AFAIK. Sorry!

It might be better to put the data into a cursor instead.

Like:

SELECT field1 + "|" + field2 FROM table INTO CURSOR temp

Then base the list on the cursor - you'll see 2 columns in the list seperated by the | character. The variable for the list will get set by the user selecting an item. In the Valid you can then GOTO that value in the temp cursor so you're then looking at what the user selected.

***************************************
Need help running those old FoxPro apps on modern systems?
 
If I understood correctly you can do it using the RANGE clause of the command (1st element option), like:

dimension myarray(3,2)
myarray(1,1) = "a"
myarray(2,1) = "b"
myarray(3,1) = "c"
myarray(1,2) = "x"
myarray(2,2) = "y"
myarray(3,2) = "z"
@ 1,5 GET myvar ;
PICTURE "@&N" ;
FROM myarray ;
RANGE 2 ;
SIZE 4,10 ;
DEFAULT 1 ;
COLOR SCHEME 2

Read the help file for more details.
 
Super mlv1055
Thanx thats wath i was searching for.
I tryed that but it didn't work in combination with # elements but after 5 times it worked.

Thanx to you !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top