genmess {inputfile {outputfile}}
Create a binary messages file from a messages source data file.
inputfile
he messages source data file. If omitted, the operator is prompted
for the name of the source file.
outputfile
The name of the binary file to be created from inputfile. If omitted,
the filename of inputfile is used with a change of extension to .mes.
None
Message files provide a means whereby text displayed by Fire can be centralized
and/or internationalized, thus providing both easy maintenance and language-switching.
Fire itself uses a messages file for the display of all system text.
Application macros running within Fire may declare a user messages file and access text within it by indexing rows. Alternatively message file identifiers pointing to message files may be declared, from which messages may be extracted and displayed.
Message files are divided into sets, arbitrarily categorized by the author. One set might contain error messages, another prompts, and so on. Sets are numbered starting from 1, and messages are numbered within each set. For full details of the source format consult message file in the section Files.
For quick access, Fire accesses a binary form of messages file, which the genmess utility creates from source data.
Fire has two system string identifiers, sys_message_file and user_message_file recording the names of the current system and user messages file. Text within the files may be accessed via the string functions sm and um, both of which take two numeric parameters: a set number and a message number, e.g.
tell sm(2,5)
The name of the system messages file at Fire startup can be defined by a mess entry in the configuration file (fire.ini), or by command parameter, e.g.
-mess=<file>
If neither is defined then Fire uses $MXSYS/etc/messages.mes. Changing this can be disastrous if you do not know what you are doing!
During a Fire session, the user messages file is totally user or application defined.
Users may also create their own message file identifiers within the Fire language, for example,
messagefile myfile
Messages from that file may then be accessed by the string function messagefile.text, for example,
string s = myfile.text(4,7)
Create mymess.mes from mymess.dat
genmess mymess.dat
The data in a message source data file comprises the set and message text. The sets should be in numerical order, as should the messages within each set. Lines beginning with a # are treated as comment lines. The maximum number of sets is 60. The maximum number of messages per set is 99.
Messages may be in the form of C format statements containing % characters,
which may be substituted at text retrieval time.
For example, assume a message line is:
The current language is %s
then this might be retrieved as follows:
string s=myfile.text(4,7,'French')
Files: |
|
Functions: |
|
Identifiers: |
sys_message_file (atable), user_message_file (atable) |
Utilities: |