![]() |
Message File Format |
A message file consists of a first line which only contains a number - the number of messages in the file. This is followed by as many messages. Messages may be separated by blank lines or comment lines as desired.
A comment line is any line which does not contain a colon ":".
A message is defined by the following syntax.
message = blank text, ":", [ { text | format descriptor } ] ;
blank text="any text not containing a colon" ;
text = ordinary text | escaped text ;
ordinary text="any sequence of characters not containing an escape character" ;
escaped text = escape character, special character ;
escape character="%" ;
special character = escape character | "n" | "t" | "<" | end of line mark ;
format descriptor="<", [ selector ], [ options ], pad expression, [ selector ], ">" ;
selector = whole number, ":" ;
pad expression = ([ sign ] padding, [ decimal padding ]) | anchor padding ;
anchor padding = [ filling ], padding ;
filling="F", any character ;
sign = "+" | "−" ;
padding = hash characters, [ justify, hash characters ] ;
decimal padding=".", hash characters ;
justify="^" ;
hash characters = hash character, { hash character } ;
hash character="#" ;
options = not defined in the library specification ;
A selector (which is a number followed by a colon) should be numbered from 1 upwards, appearing in any order in the message string format descriptors. The provision of this facility indicates by number which of the arguments to the formatting routines is to be used for which format descriptor. An example of the use of selectors is given in the first example below.
The following general restrictions on the use of format descriptors are as follows :-
In the examples below spaces in the output string are indicated by a low line for clarity only.
With message "<2:&rt; + <1:> %> <3:###>" and arguments 1, 2, 0 the resultant string is "2_+_1_>___0".
With message "<+###.##>" and argument 3.14159 the resultant string is "__+3.14".
With message "<##.##e##>" and argument 3.14159 the resultant string is "_3.14e00".
With message "<^#####>" and argument "left" the resultant string is "left__".
With message "<F*###^###>" and argument "False" the resultant string is "*False*#42;".
![]() |
Specification Index | ![]() |
Resources Index |
Comments
or enquiries should be made to Keith
Hopper . Page last modified: Tuesday, 16 May 2000. |
![]() |