ASIS: Distinguishing Between Space and Zero

How to:

The ASIS function prevents the source character string from being converted into numeric format when it is used in Dialog Manager and consists of numeric characters and blanks.


Top of page

x
Syntax: How to Distinguish Between a Space and a Zero
ASIS(argument)

where:

argument

Alphanumeric

Is the value to be evaluated. Supply the actual value, the name of a field that contains the value, or an expression that returns the value. An expression can call a function.

If you specify an alphanumeric literal, enclose it in single quotation marks. If you specify an expression, use parentheses as needed to ensure the correct order of evaluation.



Example: Distinguishing Between a Space and a Zero

The first request does not use ASIS. No difference is detected between variables defined as a space and 0.

-SET &VAR1 = ' ';
-SET &VAR2 = 0;
-IF &VAR2 EQ &VAR1 GOTO ONE;
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 NOT TRUE
-QUIT
-ONE
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 TRUE

The output is:

VAR1 EQ VAR2 0 TRUE

The next request uses ASIS to distinguish between the two variables.

-SET &VAR1 = ' ';
-SET &VAR2 = 0;
-IF &VAR2 EQ ASIS(&VAR1) GOTO ONE;
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 NOT TRUE
-QUIT
-ONE
-TYPE VAR1 &VAR1 EQ VAR2 &VAR2 TRUE

The output is:

VAR1 EQ VAR2 0 NOT TRUE

Information Builders