If text == something

Non-platform specific questions.

If text == something

Postby Troodon » Wed Jun 20, 2007 7:21 pm

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:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: If text == something

Postby makslane » Wed Jun 20, 2007 8:54 pm

Use the strcmp function:

Code: Select all
if (strcmp(mfd_enter.text, "REB") == 0)
{
    MFD = 1;
    booted = 0;
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Wed Jun 20, 2007 8:59 pm

Is this code checking if the text actors text is "REB"?
Because it's not working for me.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby makslane » Thu Jun 21, 2007 1:39 am

Yes, if the mfd_enter.text is "REB" the conditional will returns true.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Thu Jun 21, 2007 8:16 am

Ok, now it works. :D
Thanks
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest