GetTextboxText working fine, if statement dud.

Started by , Wed 21/07/2004 01:16:24

Previous topic - Next topic

Anonymous Coward

I've used GetTextBoxText to get the contents of a text box in a GUI, and according to the value returned by the Display() buffer, it works. However, I try using this if statement, and it smegs up.

I've not slept in a day or so. That could be the reasoning behind it. Whatever the textbox content, the script decides to use the else condition even if theoretically, the first if condition should match.

GUI Code:


   if (interface == 3){
      Ã,  if (button == 3){
      Ã,  Ã, string input;
         GetTextBoxText (3, 3, input);
         Display ("%s", input);
         
      Ã,     Ã,  Ã, if (input == "topsecret"){
         Ã,  Ã,  // done it.
         Ã,  Ã,  Display("Clever.");
         Ã,  Ã,  }else {
         Ã,  Ã,  Display("Think simple.");
         Ã,  Ã,  }
         Ã,  }
         }

I used AGS for a bit, took a break, forgot most of it and I'm just coming back to it. So forgive any re-established n00bism.

Cheers.

SSH

You are Yahtzee and I claim my $10!  ;)

Try StrCmp instead of == in your if statement...
12

Anonymous Coward

Gah. I swear I use too many C-syntax languages.
I'll give that a whirl, cheers.

SMF spam blocked by CleanTalk