NUM


The NUM function is used to test arguments for numeric values.

 

COMMAND SYNTAX

NUM(expression)

 

SYNTAX ELEMENTS

expression may evaluate to any data type.

 

NOTES

If every character in expression is found to be numeric then NUM returns a value of Boolean TRUE. If any character in expression is found not to be numeric then a value of Boolean FALSE is returned.

Note that to execute user code migrated from older systems correctly, the NUM function will accept both a null string and the single characters ".", "+", and "-" as being numeric. Note that the aforementioned single characters will not be considered numeric if 'dot_not_numeric' is set to 'true' in the Config_EMULATE file.

CHAR(0) is also considered numeric, therefore NUM(CHAR(0)) returns TRUE.

Note if running jBC in ros emulation the "." , "+" and "-" characters would not be considered numeric.

 

EXAMPLE

LOOP
    INPUT Answer,1
    IF NUM(Answer) THEN BREAK ;* Exit loop if numeric
REPEAT


jBC