HTML5: Empty string or spaces == NaN???

I’ve discovered this weird bug: When you make empty variable (no 0, no anything) or make it contain only spaces, when used on VariableString it returns NaN (not a number) instead of empty string (or containing spaces) as it should.

Don’t know if it is also in native version, but since NaN is specific to JS, not C++, it is unlikely.

//edit: Came into this bug when working on my dialog engine. For convenience I’m storing fixed number of lines for each message, with some empty if necessary. Haven’t try yet empty character 160, only spaces, so maybe it will be temporary fix.

//edit #2: Nope, empty character of ASCII code 160 doesn’t do job either.

//edit #3: Temporarily fixed using euro (€) character instead of space, but only works because my font doesn’t have an euro sign in it (custom made)

Fixed :smiley:
Silly javascript returns false when applying isNaN function to string which is empty or having spaces, but parseFloat returns NaN when applied to the same string! :angry:

Just check if it is empty string first :wink:!