How to: |
Reference: |
Available Languages: reporting
The ASIS function distinguishes between a space and a zero in Dialogue Manager. It differentiates between a numeric string, a constant or variable defined as a numeric string (number within single quotation marks), and a field defined simply as numeric. ASIS forces a variable to be evaluated as it is entered rather than be converted to a number. It is used in Dialogue Manager equality expressions only.
ASIS(argument)
where:
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.
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
In general, Dialogue Manager variables are treated as alphanumeric values. However, a Dialogue Manager variable with the value of '.' may be treated as an alphanumeric value ('.') or a number (0) depending on the context used.
-SET &DMVAR1='.'; -SET &DMVAR2=10 + &DMVAR1; -TYPE DMVAR2 = &DMVAR2
The output is;
DMVAR2 = 10
-SET &DMVAR1='.'; -SET &DMVAR2=IF &DMVAR1 EQ ' ' THEN 'TRUE' ELSE 'FALSE'; -SET &DMVAR3=IF &DMVAR1 EQ '.' THEN 'TRUE' ELSE 'FALSE'; -SET &DMVAR4=IF &DMVAR1 EQ '0' THEN 'TRUE' ELSE 'FALSE';
-SET &DMVAR2=IF ASIS('.') EQ '.' THEN 'TRUE' ELSE 'FALSE'; -SET &DMVAR3=IF ASIS(' ') EQ ' ' THEN 'TRUE' ELSE 'FALSE'; -SET &DMVAR4=IF ASIS('0') EQ '0' THEN 'TRUE' ELSE 'FALSE';