Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning values from a listbox created from an array
Message
 
À
01/05/2001 12:13:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00501985
Message ID:
00502031
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>>>I have a 2 column listbox populated from an array. The first column is a date and the second is a batch number. When the user double clicks on a value in the list box, I want to store the date AND the batch number to a variable. My problem is that displayvalue only gives me the first column. Is there a way to get the literal value of the second column (batch number) also.
>>>
>>>
>>>
DATE       BATCH
>>>01/01/01       A
>>>01/01/01       B
>>>01/01/01       C
>>>01/02/01       A
>>>01/02/01       B
>>>
>>>I want to be able to select any ONE of the above by double clicking on it. Right now all I can return is the date so ALL of the above with the same date match the memvar.
>>>For example if the second item in the list is double clicked, I want to store "01/01/01 B" not just "01/01/01" to the memvar.
>>>
>>>Thanks in advance
>>
>>
>>for lx = 1 to this.listcount
>>   if this.selected(lx)
>>      lcMyvar = this.list(lx,1)+this.list(lx,2)
>>   endif
>>endfor
>>
>>
>>Things to remember: if your list is set to multiselect = .T. and you have more than one item selected you will get the last row selected. Also, the appropriate function needs to be used to convert to and from whatever datatype you are dealing with. The + concat operator only works for chars.
>
>Eric,
>No need to to traverse list. Listindex would do it. He says 'dblclick'.
>Next listbox.list always have char type.
>Cetin

My examples on this forum are meant to start someone thinking of the many possibilities of the language. Not, do all, end all, best way examples...

For example: Would ListIndex work if you wanted to perform some other validation on the other rows in the list during the same operation?
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform