PreviousNext

Extended Format Notation for Message Text

A slightly extended notation allows you to define message texts in the sams file that will (if desired) have format specifiers in their application code forms (that is, in the .c and .msg files output by sams), but which will be replaced by some specified string constant in the message texts that are generated for documentation use (that is, in the .sml and .man files).

The notation consists in surrounding the format specifier and alternative constant with < and > (angle bracket) characters, and separating the two with a | (vertical bar). (You can use a preceding \ (backslash) to escape these symbols.) For example, the following message text field:

text Can't open input file %s for reading

would become something like the following:

text Can't open input file <%s|filename> for reading

This message text definition, when processed by sams, would generate a format string with %s in the .c and message files, but this format specifier would be replaced by the string filename in the .sml and .man file versions.