Local variables

Local variables are available to enabled statements in the same function. Functions using local variable names cannot refer to the same local variables in other functions. This is why they are called locals, because they are local to the function they are being used in.

To declare local variables in a function, use one of the variable declaration instructions at the beginning of the function after the Function statement:

Boolean, Byte, UByte, Integer, Short, UShort, Long, Int32, UInt32, Int64, UInt64, Real, Double, String

For example, the following function declares several local variables:

Function test
  Integer intVar1, intVar2
  Real realVar
  String dataStr$
  Integer array(10)
Fend