Home   Help Search Login Register  

Author Topic: how check for an empty variable?  (Read 459 times)

0 Members and 2 Guests are viewing this topic.

Coyote @ rage

  • Guest
how check for an empty variable?
« on: 18 Feb 2003, 13:17:46 »
I have a dialog where the player is supposed to enter text into an RscEdit.
How can I check, if the the user did not enter anything?
If he doesnÂ't, it doesnÂ't return an empty string, it returns nothing, so
? _enteredText == " "     does no work.


Coyote @ rage

  • Guest
Re:how check for an empty variable?
« Reply #1 on: 18 Feb 2003, 13:24:47 »
DonÂ't bother, found a workaround:

In Description.ext, itÂ's possible to set a default text:

class RscEdit
{
       type = CT_EDIT;
       idc = -1;
       style = ST_LEFT;
       font = FontHTML;
       sizeEx = 0.02;
       colorText[] = {0, 0, 0, 1};
       colorSelection[] = {0.5, 0.5, 0.5, 1};
       autocomplete = false;
       text = "Default Text";
};

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:how check for an empty variable?
« Reply #2 on: 19 Feb 2003, 15:18:30 »
Well, actually, any boolean with an undefined variable value will return "FAlse", so:
?myvar == myvar:goto "IsDefined"
#not defined
Dinger/Cfit