DataBasic Reference > Statements and Intrinsic Functions > N > NUM Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

NUM Function (DataBasic) (m618703+num_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

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.

RealityV15.1 (MoTW) Revision 7Comment on this topic