parseNumber – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
(Please use the talk page for discussions)
 
(→‎Huh?: new section)
Line 12: Line 12:
  };
  };
[[User:MulleDK13|MulleDK13]] 09:26, 11 July 2010 (CEST)
[[User:MulleDK13|MulleDK13]] 09:26, 11 July 2010 (CEST)
== Huh? ==
Those past 3 edits make my head hurt. where did that old note come from? It went, it came, it went again... --[[User:Benargee|Benargee]] ([[User talk:Benargee|talk]]) 00:47, 3 October 2014 (CEST)

Revision as of 00:47, 3 October 2014

  • If the text does not represent a number ("abc" for example), parseNumber will return 0 (zero). It is therefore not possible to use parseNumber to determine if the string contains a valid number or not.

I beg to differ.

_stringNotContainingValidNumber = "abc";
if(parseNumber _stringNotContainingValidNumber == 0 && _stringNotContainingValidNumber != "0") then
{
    comment "INVALID NUMBER";
}
else
{
    comment "VALID NUMBER";
};

MulleDK13 09:26, 11 July 2010 (CEST)

Huh?

Those past 3 edits make my head hurt. where did that old note come from? It went, it came, it went again... --Benargee (talk) 00:47, 3 October 2014 (CEST)