LOAD

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

LOAD

mapp Services V5.16

Pragma LOAD loads the specified file. The parsing of the file that contains pragma LOAD waits for the specified file to be loaded completely before resuming.

The loaded file has its own scope for elements (e.g. variables), and the elements are also permitted to be used in other programs. The elements loaded by #include directives always have the scope that applies where the #include is located. These elements cannot be used in other programs.

Syntax

#pragma LOAD 'filename'

Examples

Loading a variable declaration file

#pragma LOAD 'points.var'
PROGRAM _MAIN
  MoveAR(Home);  // Variable "Home" is defined in "points.var"
END_PROGRAM

Loading a Structured Text program in advance

The pragma loads file "draw.st". If there is a syntax error in "draw.st", then the current program also fails to load. If this pragma is omitted and there is a syntax error in "draw.st", then a runtime error will be reported when the current program is executed.

#pragma LOAD 'draw.st'   // Load motion program
PROGRAM _MAIN
    EXEC('draw.st');     // Execute the motion program
END_PROGRAM