Domain: String functions/test functions
The IS-VARIABLE-NAME( ) function checks whether the specified string is a syntactically correct variable name. This check is a pure syntax check. It does not check whether a variable with this name exists.
Format
IS-VARIABLE-NAME( ) IS-VAR-NAME( ) |
STRING = string_expression |
Result type
BOOLEAN
Input parameters
NAME = string_expression
Designates the string to be checked.
Result
TRUE
“string_expression” is a valid variable name.
FALSE
“string_expression” does not satisfy the syntax rules for variable names and is therefore not a valid variable name.
Error messages
No error messages
Example
/DECLARE-VARIABLE A /A = '1234' /B = IS-VARIABLE-NAME(STRING = A) /SHOW-VARIABLE B B = FALSE
The variable A is declared and the value '1234' is assigned to it. IS-VARIABLE-NAME( ) now checks to see if variable A contains a valid variable name: ’1234’ is not a valid variable name, since variable names cannot begin with a number.
/B = IS-VARIABLE-NAME(STRING = 'A') /SHOW-VARIABLE B B = TRUE
IS-VARIABLE-NAME( ) checks the string ’A’: ’A’ is a valid variable name.