GLOBALS

The GLOBALS / END GLOBALS block and the GLOBALS instruction.

Syntax 1: Global block declaration

GLOBALS
  declaration-statement
  [,...]
END GLOBALS
  1. declaration-statement is a variable, constant or type declaration.

Syntax 2: Importing definitions from a globals file

GLOBALS "filename"
  1. filename is the file containing the definition of globals. filename can be a relative or an absolute path. To specify a path, the slash (/) directory separator can be used for UNIX™ and Windows® platforms.
  2. Use this syntax to include global declarations in the current module.

Usage

In order to extend the scope of variables, constants or user types to the whole program, define a module containing a GLOBALS ... END GLOBALS block and include this global module with the GLOBALS "filename" statement in other modules.

The filename should contain the .4gl suffix. However, the compiler uses the file name as it is. Therefore it can accept other file extensions such as GLOBALS "stock.glb".

The filename can be a relative or an absolute path. To specify a path, the slash (/) directory separator can be used for UNIX and Windows platforms.
Note: When the filename specified by GLOBALS defines a relative file path, the globals file will be searched relatively to the current directory when executing fglcomp. As a general rule, execute fglcomp in the directory of the source file passed as argument.