OK, here's my problem. I have a text file which is tab delimited. So it looks like this:
VB Code:
21 entryA 22 entryB 23 entryC
Anyway, it has a lot of things in it. Instead of putting all items into a listbox collection and then making a casewhere structure in the list's SelectedIndexChanged event to compare the right number to each list entry (To store in a variable), I was thinking that I would use StreamReader to read from the text file and somehow store the numbers seperately from the entries. Using casewhere means that it would be an enourmous ammount of coding (Over 200 entires).
This allows me to:
a) Read the file.
b) Put the entries into the list without their corresponding numbers.
c) When I then click on an entry, it compares it to it's corresponding number.
d) That number is stored in a variable and the user never sees it.
The point is to avoid using a long casewhere structure with over 200 cases. Another advantage is that what if I want to change entires in the list? So much easier. Also, another snag is that the entries in the list ARE NOT arranged according to their number, but arranged alphabetically. So this explains why I can't just get the index number of the entry from the list. I'm also not really experienced in the area of using arrays or records, but I have I feeling I'll be using them to solve this. I do know how to use streamreader though, and 1D arrays.
I have a feeling I haven't explained something well enough or just enough. Thanks in advance. :thumb:
