Summary:
See also: OPTIONS, SHOWHELP(), fglmkmsg, Localized Strings.
Message Files define text messages with a unique integer identifier. You can create as many message files as needed. Message files are typically used to implement application help system, especially when using the Text User Interface mode.
In order to use a message file, you need to do the following:
Message files are supported for backward compatibility. You should also have a look at the Localized Strings feature.
filename.msg
{
message-definition
| include-directive
}
[...]
where message-definition is:
.message-number
message-line | new-page
[...]
where include-directive is:
.include file-name
and where new-page is:
^L (Control-L, ASCII 12)
In order to use message files in a program, the message source files (.msg) must be compiled with the fglmkmsg utility to produce compiled message files (.iem).
The following command line compiles the message source file mess01.msg:
fglmkmsg mess01.msg
This creates the compiled message file mess01.iem.
For backward compatibility, you can specify the output file as second argument:
fglmkmsg mess01.msg mess01.iem
The .iem compiled version of the message file must be distributed on the machine where the programs are executed.
In order to use compiled message files (.iem) in programs, you must first specify the message file with the OPTIONS HELP FILE command:
01
OPTIONS HELP FILE "mymessages.iem"
The message file will first be searched with the string passed to the OPTIONS HELP FILE command (i.e. the current directory if the file is specified without a path), and if not found, the DBPATH/FGLRESOURCEPATH environment variable with be used.
After the message file is defined, you can start the help viewer by calling the SHOWHELP() function:
01
CALL showhelp(1242)
You can also use the HELP keyword in a dialog instruction like INPUT to define particular message number for that the dialog:
01
INPUT BY NAME ... HELP 455
The help viewer will automatically display the message text corresponding to the number when the user pressed the help key. By default, the help key is CONTROL-W in TUI mode and F1 in GUI mode.
01
.10102
This is help about option 103
.10204
This is help about help05
.10306
This is help about My Menu
01
MAIN02
OPTIONS03
HELP FILE "help.iem"04
OPEN WINDOW w1 AT 5,5 WITH FORM "const"05
MENU "My Menu"06
COMMAND "Option 1" HELP 10107
DISPLAY "Option 1 chosen"08
COMMAND "Help"09
CALL SHOWHELP(103)10
END MENU11
CLOSE WINDOW w112
END MAIN