Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JJJAC55 on Fri 01/04/2005 19:11:00

Title: TEXT BOX Q.
Post by: JJJAC55 on Fri 01/04/2005 19:11:00
OK, how would I have an input box asking them a question, and then an if statement with the answer.

      string answer;
      InputBox("Buy L Coke?", answer);
      if (answer == ) {
        DisplaySpeech(ROGER, "I bought a Coke");
      }
      else {
        DisplaySpeech(ROGER, "I didnt bought a coke");
      }
Title: Re: TEXT BOX Q.
Post by: strazer on Fri 01/04/2005 19:43:33
You have to use StrComp or StrCaseComp to check strings:


if (StrCaseComp(answer, "Yes") == 0) {


Check the manual.