Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: am on Sat 03/05/2003 23:04:52

Title: List Box Question
Post by: am on Sat 03/05/2003 23:04:52
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?
Title: Re:List Box Question
Post by: RickJ on Sun 04/05/2003 02:41:31
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.