Back to Contents


Message Files

Summary:

See also: OPTIONS, SHOWHELP(), fglmkmsg


Basics

Purpose:

Message Files define text messages. Each message is identified by a number that can be used by programs.

Syntax:

filename.msg

Notes:

  1. filename is the name of the message source file.

Syntax of a message file:

{
  message-definition
| include-directive
}
[...]

where message-definition is:

.message-number
message-line
[...]

where include-directive is:

.include file-name

Warnings:

  1. Multi-line messages will include the new-line (ASCII 10) characters.

Usage:

The following steps describe how to add help messages to your application:

  1. Create your help file containing the help messages and their identifier.
  2. Compile the help file with fglmkmsg tool.
  3. In your application, specify the HELP FILE in the OPTIONS block.
  4. Use messages from the help file in your application, either with the HELP keyword, or with the SHOWHELP() function.

Compiling Message Files

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

Warning: The .iem compiled version of the message file must be distributed on the machine where the programs are executed.


Example

Message source file example:

01 .101
02 This is help about option 1
03 .102
04 This is help about help
05 .103
06 This is help about My Menu

Application using this help message:

01 MAIN
02     OPTIONS
03         HELP FILE "help.iem"
04     OPEN WINDOW w1 AT 5,5 WITH FORM "const"
05     MENU "My Menu"
06         COMMAND "Option 1" HELP 101
07 	       DISPLAY "Option 1 chosen"
08         COMMAND "Help"
09             CALL SHOWHELP(103)
10     END MENU
11     CLOSE WINDOW w1
12 END MAIN