why is it that the code:
string KNARKNAR;
KNARKNAR = "fufu";
if(KNARKNAR == "fufu")
{
Display("POOPOO");
}
never prints the word POOPOO...
I can't get an if statement to read what's in a string variable properly! What am I doing wrong?!?! WHA WHA WHA!
Tchh! Try:
Quote
StrComp (string str1, string str2)
Compares the strings STR1 and STR2. Returns zero if they are identical, and non-zero if they are not
Using "==" tries to interpret the strings as numbers in some undefined way, no doubt.
and also StrCopy(KNARKNAR,"fufu"); instead of KNARKNAR="fufu". Remember that strings and ints behave differently.
OOPS! I just found Strcomp() in the instructions!!
You can delete this thread if you please as it turns out it was a stupid question!
My apologies!
What version of AGS are you using?
v2.55 shouldn't compile the above script - it should give you an error message telling you to use the StrCopy function instead.