Initializes a local memory variable or array
LOCAL <xVar> [:= <xInit> ]
<xVar> Name of a memory variable or array.
<xInit> Value to be assinged to a variable or array
This command created a LOCAL memory variable or array. The name of either is specified in <xVar>. If more then one variable is being initialized with the LOCAL command, separate each entry with a comma. If a variable or an array is to be assingned a start-up value, that expression may be specified in <xInit> and folling. Is Strong type compile mode is used, the Compiler will check if the value recived matchs the type specified in <xType>.
LOCAL varibles are symbols generated at run time and are resolved at compile time. The visibility and life span of a LOCAL variable or array is limited to the function or procedure in which it is defined.
No macro expansions are allowed in the LOCAL declaration statement.
No Harbour command other then FUNCTION, PROCEDURE, PUBLIC, PRIVATE, PARAMETERS, MEMVAR, STATIC and FIELD, may precede the LOCAL command.
LOCAL array reference may not be initialized (i.e., assigned values) on the same command line as the LOCAL command statement. This can be done later in the program.
LOCAL variables and arrays are not affected by the RELEASE command.
PROCEDURE Main() LOCAL n, lVar n := iif( lVar, "A", 3 ) n := 2 n := "a" n := Seconds() + 2 n := Int( Seconds() + 2 ) RETURN
This is CA-Cl*pper v5.2 compliant
This is available on all platforms
FIELD, PRIVATE, PUBLIC, STATIC, MEMVAR