Contents of the Message File
The message file consists of groups of four lines—one group for each message you want to write. The four lines are as follows:
1. A string that acts as the keyword to identify the message when you call
ProMessageDisplay() This keyword must be unique for all
Creo+ messages.
2. A string that will be substituted for the first string when you call
ProMessageDisplay(). This string acts like the format string in a
printf() statement. By modifying this line in the message file, you can modify the text of the message without modifying your C code.
3. The translation of the message into another language (can be blank).
4. An intentionally blank line reserved for future extensions.
The format string (line 2 in the message file) differs from the format string of a printf() in the following respects:
• The conversion specifications (%d, %s, and so on) must include an argument number corresponding to the position of that argument in the subsequent list (starting at 0). For example, instead of %d, %s, you must have %0d,%1s, and so on. If you want to specify a field width, put it in parentheses between the position number and the type specifier; for example, %0(5.3)f.
• The separator ||| between message text and a conversion specification signifies that the conversion specification is for a default value for user input. This default value will appear in the text box created using the keyboard input functions, such as
ProMessageIntegerRead(). Refer to
Using Default Values for more on default values.
• The conversion character w is available for wide strings.
• You do not need the character constant (\n) at the end of the format. Creo+ automatically inserts a new line when necessary.
|
 The length of any line in the message file must not exceed 4096 wide characters.
|
The following table lists the conversion characters and their corresponding data types.
|
Conversion Character
|
Data Type
|
|
f
|
Float (or double)
|
|
d
|
Decimal integer
|
|
s
|
Ordinary string (or type char[])
|
|
w
|
Wide character strings
|
|
e
|
Exponential
|
|
g
|
Either float or exponential, as appropriate
|
Ensure that the keyword string is similar to the format string to make your C code easy to interpret. Add a prefix that is unique to your application to the keyword string. The examples in this manual use the unique prefix “USER.”