Page 1 of 1

If text == something

PostPosted: Wed Jun 20, 2007 7:21 pm
by Troodon
I'm desperate, :(
I've trying to do a text value check with many different ways and always there is something that doesn't work!
How can I make this?
Code: Select all
if (mfd_enter.text == "REB")
{
    MFD = 1;
    booted = 0;
}


I'm sure I've done this earlier. :shock:

Re: If text == something

PostPosted: Wed Jun 20, 2007 8:54 pm
by makslane
Use the strcmp function:

Code: Select all
if (strcmp(mfd_enter.text, "REB") == 0)
{
    MFD = 1;
    booted = 0;
}

PostPosted: Wed Jun 20, 2007 8:59 pm
by Troodon
Is this code checking if the text actors text is "REB"?
Because it's not working for me.

PostPosted: Thu Jun 21, 2007 1:39 am
by makslane
Yes, if the mfd_enter.text is "REB" the conditional will returns true.

PostPosted: Thu Jun 21, 2007 8:16 am
by Troodon
Ok, now it works. :D
Thanks