Modules

module    <name_1>  <name_2>  <name_3>  <name_N>

the module statement is used to define modules

e.g.

module    BERT   JACK   FRED :: U_FRED

XPE modules are similar to C++ classes

vaiables that belong to modules are equivalent to static members in C++ classes (only one copy of the member can exist)

XPE modules do not allow constructors or destructors

functions belonging to a module are equivalent to C++ methods and access their object via the XPE 'this' variable.

e.g.

a = struct()

a . b = 0

a . BERT :: fred()

declaring a method that belongs to a particular module is done by fully qualifying the method name

e.g.

proc    BERT :: fred

<statement>

endproc

 

if a structure to be operated on belongs to a particular module (i.e. is of a particular class) then the fully qualified function name does not need to be specified when the function is applied to the structure.

i.e.

a . fred()

is equivalent to

a . BERT :: fred()

if 'a' belongs to module BERT

modules can belong to other modules to any depth

e.g.

proc    BERT :: JIM :: PAUL :: fred

<statement>

endproc