Variables are assigned values in an ASL script or at adapter startup. “Variable assignment at startup” on page 38 describes how to specify variable values at startup.

ASL variables do not have a declared type, the values assigned to them are typed. Variable values can have the following types:

  • numeric

    ASL stores all numbers as double-floating point.

  • string

  • binary

  • Boolean

  • list

  • table

  • object handle

    The section Chapter 6, “Interfacing with a Domain Manager,” provides additional information.

  • datetime

    The section “time() function” on page 89 provides additional information.

    A variable name can consist of a letter or an underscore, followed by any number of letters, underscores, and digits. A variable name is case-sensitive. Uppercase and lowercase letters are distinct.

    Note:

    Certain ASL words are reserved and should not be used as identifiers or variables, as described in “Reserved words” on page 149.

    Any variable can be assigned different types of values. For example, starting with a basic ASL statement:

    x = ”string”;
    

    The variable x can then be used to store a value:

    x = 5.62;
    

    It can also store a Boolean value:

    x = TRUE;
    

    For most values, ASL converts one type of value to the appropriate data type for use in a function or expression. In this example, the var_w variable is assigned a string of numeric characters.

    var_w = ”3498”;
    

    The variable, var_w, can be added to a number.

    var_y = var_w+100;
    

    This statement is valid. The number 100 is added to the numeric equivalent of the value stored in var_w. There is no intermediate step.

    Note:

    The semicolon terminates the end of these assignment actions in ASL.