List Box Question

Started by am, Sat 03/05/2003 23:04:52

Previous topic - Next topic

am

I'm using a list box to enable the player to choose music he wants to hear. the music is "picked up" during the game and may be in diffrent order for a diffrent game.
I know I can get the number of the choice the user made and it's text, but how can I compare it to the possebilities I have to know which music to play? is there a string compare function? any other way?

RickJ

Sting Compare
if (StrComp(string1, string2)==0) {    // Strings were equal
}
else {  // Strings were NOT equal
}

List Box Text
string buf;
int      item;

item = ListBoxGetSelected(GUI, LIST);
ListBoxGetText(GUI, LIST, item, buf);
if (StrComp(buf, "something")==0) {    // Strings were equal
}
else {  // Strings were NOT equal
}

Hope this is helpful.  If not come back and ask more questions.

SMF spam blocked by CleanTalk