Module variables

Module variables are available to all functions in the same program file. To declare module variables in a program, use one of the variable declaration instructions at the beginning of the program before any Function statements:

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

TIP


In order to indicate that a variable is module level, precede the name with “m_”, as shown in the example below. With this, you can improve the program readability.

For example, the following function declares several module level variables:

' Module level vars, used by all functions in this file
Integer m_IntVar1, m_IntVar2
Real m_RealVar
String m_DataStr$
Integer m_Array(10)
Function main
  m_IntVar1 = 25
  Call test
Fend
Function test
  Print mm_IntVar1
Fend