General information
Category:
Coding, syntax & commands
I agree, but in the case of multiselects, then you'd still have the same issue because the SelectedId would have to be an array itself. I guess for consistency, iterating through the array this way is, at least, always the same.
Alan
>>I think you still need the index. SelectedId() returns .T. or .F. based on SelectedId(nIndex).
>>
>>Also, if your list is sorted, the id gets messed up and SelectedID(3), for instance, could return what, to the user, looks like item 5 or 10 or whatever. I guess that would likely not matter much, but it feels counterintuitive to me (on a sorted list).
>
>You're right. I just made an experiment. SelectedID worked without index, but returned .f. I added SelectedID(1) and it returned either .f. or .t. I think, it's weird, that ListBox doesn't have SelectedID property to return the item selected in case of MultiSelect = .f. Or it could be an array property. Sounds silly to always iterate through the list if we want to find out items selected. Some internal array property would be nice, do you think?
>
>Thanks.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only