Compiled 4gl source files as well as compiled 4gl libraries can be imported to any 4gl program by IMPORT FGL statement:
IMPORT FGL fgl_lib
IMPORT FGL fgl_file
MAIN
...
END MAIN
When importing compiled files (.4o) and libraries (.4a) by IMPORT FGL, use only filename without file extensions.
If you import any 4gl module in such a way, there will be no need to link it to the program by means qlink.
No circular imports are allowed: If import module A from module B, and module B from module A, compilation will fail.
After any 4gl module was imported, its functions, variables, constants, and data types become available for and from the importing source module and can be called like any other 4GL function, variable, etc.:
IMPORT FGL fgl_lib
MAIN
CALL myfunction() -- function defined in fgl_lib
END MAIN
By default, all the elements listed above are private. To make them public, use PUBLIC keyword when declaring them:
IMPORT FGL fgl_lib
PUBLIC DEFINE var INT
MAIN
...
END MAIN