11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NUM<br />

Syntax<br />

NUM(expr)<br />

Description<br />

The <strong>UniBasic</strong> NUM function determines if an expression is numeric. If expr is<br />

numeric, NUM returns 1. Otherwise, it returns 0. expr can be any valid <strong>UniBasic</strong><br />

expression. The NUM function returns 0 for any multibyte character.<br />

With null value handling on, this function returns 1 for the null value.<br />

The nonnumeric characters in the following table produce a result of 1.<br />

Examples<br />

In the following example, the program segment prints 0 because VAR contains alphabetic<br />

characters:<br />

VAR = 'ABC'<br />

PRINT NUM(VAR)<br />

In the next example, the program segment prints 1 because VAR contains an integer:<br />

VAR = -123<br />

PRINT NUM(VAR)<br />

1-484 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

Character Description<br />

+ Plus sign<br />

- Negative sign<br />

. Decimal point<br />

Nonprinting Null value<br />

Nonnumeric Characters

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!