Skip to content

Local Variables

Variables declared within a Procedure or Function are called local variables. A local variable's scope is only inside the Procedure or Function in which it is declared. A variable declaration is deemed to be within a Procedure or Function if the declaration occurs between a Procedure .. End_Procedure or Function .. End_Function command pair.

Examples of Local Variable Declarations

Procedure DoNothing
    Integer iNew
    String  sTest// code exists here that uses the local variables
End_Procedure
// Code outside the procedure cannot access the local variables

The point of local variables is that they cannot be accessed or changed outside of the procedure or function in which they are declared. This means that they can be used inside the procedure with the assurance that no code outside the procedure can corrupt their value.

See Also