Example 3: PUBLIC module variables

This example declares public and private module variables. Public variables can be shared with other modules.

File "mydebug.4gl":
PUBLIC DEFINE level INTEGER,
              logfile STRING
PRIVATE DEFINE count INTEGER

FUNCTION message(m)
  DEFINE m STRING
  IF level THEN
     -- Write message to debug_logfile
     DISPLAY m
  END IF
  LET count = count + 1
END FUNCTION
File "mymain.4gl":
IMPORT FGL mydebug

MAIN
  LET mydebug.level = 4
  LET mydebug.logfile = "myfile.log"
  CALL mydebug.message("Some debug info...")
END MAIN