NUM Function

Determines whether an expression is a numeric value.

Syntax

NUM(expression)

Syntax Elements

expression Any valid DataBasic expression or a string, substring, or value.

Comments

NUM returns a value of 1 (true) if expression evaluates to a number or a numeric string (see Numeric Data for the format of a numeric string).

NUM returns a value of 0 (false) if expression evaluates to a non-numeric string.

A null string is considered to be a numeric string.

A string containing a system delimiter is considered to be non-numeric.

Examples

A1=NUM(123) and A2=NUM("123")

Both assign a value of 1 to variable A1.

A2=NUM("ABC")

Assigns a value of 0 to variable A2.

A3=NUM("123":@AM:"321")

Assigns a value of 0 to variable A3, because @AM is an attribute mark.

IF NOT(NUM(VALUE)) THEN PRINT "NON-NUMERIC DATA"

Prints the message NON-NUMERIC DATA if VALUE is not a number or a numeric string.

IF NUM(I:J) THEN GOTO 5

Transfers control to statement 5 if the values of both I and J are numbers or numeric strings.