|
-
Apr 20th, 2001, 04:45 PM
#1
Im gonna add about 1000 items to a combo box. And then when someone clicks a button, i need to get the corresponding number to each string. My quesiton is do i have to compare whatever string they pick to 1000 others using case statements, or can i give data to each string that i give the combo box, and then just get the data with the string.
-
Apr 20th, 2001, 04:50 PM
#2
Monday Morning Lunatic
How about an array using the index of the combo box:
Code:
int pArray[1000] = { ... };
Although if there's 1000 items it would be a much better idea to load them dynamically from a data file.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 20th, 2001, 04:59 PM
#3
I thought about that, but i want the combo box to be sorted, so all the items would be out of wack.
-
Apr 20th, 2001, 05:07 PM
#4
Monday Morning Lunatic
An array of UDTs? Try using the STL map class?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 20th, 2001, 07:51 PM
#5
Class? Are you talking MFC? Cuz im not using MFC.
-
Apr 21st, 2001, 03:02 AM
#6
Monday Morning Lunatic
Nope. I'm talking the C++ Standard Library, of which the STL (Standard Template Library) is a part.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|