Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:tk:tools:mkmsgf [2024/01/19 02:24] – created prokushev | en:docs:tk:tools:mkmsgf [2024/09/05 01:46] (current) – [Syntax] prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | The following is from the OS/2 Tools Reference book that is included with the OS/2 Tookit. My additional comments are mark with a bold Mike Note:. | + | ====== MKMSGF ====== |
- | Syntax | + | |
- | MKMSGF infile outfile [options] | + | ===== Brief ===== |
- | OR | + | |
- | MKMSGF @controlfile | + | |
- | The infile field specifies the input file that contains | + | Build message file from message source |
- | The outfile field specifies the output file created by MKMSGF. The output-file name can be any valid OS/2 file name, optionally preceded by a drive letter and a path. | ||
- | To differentiate between the two files, the following convention is recommended, | + | ===== Syntax ===== |
+ | |||
+ | < | ||
+ | |-|v|-|-|-|v|v|-|-|-|v|MKMSGF|-@2| | ||
+ | | |`|drive|' | ||
+ | |||
+ | |-@2|v|-|-|-|v|v|-|-|-|v|infile|-@2| | ||
+ | | |`|drive|' | ||
- | The infile file should have a .TXT extension. The outfile | + | |-@2|v|-|-|-|v|v|-|-|-|v|outfile|-@2| |
+ | | |`|drive|' | ||
- | Note: The output file cannot have the same file name and extension as the input file. | + | | |
- | Help | + | |-@2|^@1f|v|-|-|-|v|^|(| |
+ | | | |)|/?|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/V|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/Q|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/D <DBCS range or country> | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/P codepage|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/L < | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/I path|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |)|/A|(| | ||
+ | | | |!| | | |!| | ||
+ | | | |`|/ | ||
- | There are two ways to display MKMSGF help. | ||
- | Short Syntax Help | ||
- | To display a short version of MKMSGF syntax help, type MKMSGF at the prompt, with no parameters. The following will be displayed: | + | </ |
- | Operating System/2 Make Message File Utility (MKMSGF) | ||
- | Version 4.00.007 Oct 4 2001 | ||
- | Copyright (C) IBM Corporation 1987, 1990, 1993-2001 | ||
- | Copyright (C) Microsoft Corp. 1987, 1990 | ||
- | All rights reserved. | ||
- | | + | ===== Arguments ===== |
- | [/D <DBCS range or country> | + | |
- | Long Help | + | * infile - the input file that contains message definitions. The input-file name can be any valid OS/2 file name, optionally preceded by a drive letter and a path. |
+ | * outfile field specifies the output file created by MKMSGF. The output-file name can be any valid OS/2 file name, optionally preceded by a drive letter and a path. | ||
- | To display a longer version of MKMSGF help, including defaults, country codes, and language IDs, type MKMSGF /? at the prompt. The following will be displayed: | + | A valid DBCS range is: n10,n11,n20,n21,...,nn0,nn1 |
- | Operating System/2 Make Message File Utility (MKMSGF) | + | A single number is taken as a DBCS country code. |
- | Version 4.00.007 Oct 4 2001 | + | |
- | Copyright (C) IBM Corporation 1987, 1990, 1993-2001 | + | |
- | Copyright (C) Microsoft Corp. 1987, 1990 | + | |
- | All rights reserved. | + | |
- | Use MKMSGF as follows: | + | The valid OS/2 language/ |
- | MKMSGF < | + | |
- | [/D <DBCS range or country> | + | |
- | [/L < | + | |
- | where the default values are: | + | |
- | code page - none | + | |
- | DBCS range - none | + | |
- | A valid DBCS range is: n10, | + | |
- | A single number is taken as a DBCS country code. | + | |
- | | + | |
Language ID: | Language ID: | ||
Line 90: | Line 91: | ||
RMS | RMS | ||
ROM | ROM | ||
- | RUS | + | RUS |
SHL | SHL | ||
SHC | SHC | ||
Line 102: | Line 103: | ||
SLO | SLO | ||
- | For a complete list of code pages and country codes, see the code page table under COUNTRYCODE in the online book Control Program Programming Guide and Reference. | + | For a complete list of code pages and country codes, see the code page table under [[https:// |
- | Input Message File | + | |
- | The input message file is a standard ASCII file that contains three types of lines: | + | ===== Output File ===== |
- | Comment lines | ||
- | Component identifier line | ||
- | Component message lines | ||
- | |||
- | Comment Lines | ||
- | |||
- | Comment lines are allowed anywhere in the input message file, except between the component identifier and the first message. Comment lines must begin with a semicolon (;) in the first column. | ||
- | |||
- | In the Input Message File Example, the comment lines are | ||
- | |||
- | ; This is a sample of an input | ||
- | ; message file for component DOS | ||
- | ; starting with three comment lines. | ||
- | Component Identifier Line | ||
- | |||
- | The component-identifier line contains a three-character name identifier that precedes all MKMSGF message numbers. | ||
- | |||
- | In the example, the component identifier is DOS. | ||
- | Component-Message Lines | ||
- | |||
- | Each component-message line consists of a message header and an ASCII text message. | ||
- | |||
- | The message header is comprised of the following parts: | ||
- | |||
- | A three-character component identifier | ||
- | A four-digit message number | ||
- | A single character specifying message type (E, H, I, P, W, ?) | ||
- | A colon (:) | ||
- | Followed by a blank space. | ||
- | |||
- | The following message types are used: | ||
- | Type Meaning | ||
- | E Error | ||
- | H Help | ||
- | I Information | ||
- | P Prompt | ||
- | W Warning | ||
- | ? no message assigned to this number | ||
- | |||
- | Mike Note: | ||
- | This is an additional example: | ||
- | < | ||
- | [ XXX0000T: Message .... ] | ||
- | |||
- | The message header is comprised of the following parts: | ||
- | |||
- | Comp_ID - A three-character component identifier | ||
- | Msg_Num - A four-digit message number | ||
- | Msg_Type - A single character specifying message type (E, H, I, P, W, ?) | ||
- | |||
- | The message header must begin in the first column of the line. Only one header can precede the text of a message, although a message can span multiple lines. | ||
- | |||
- | Message numbers can start at any number, but messages must be numbered sequentially. If you do not use a message number, you must insert an empty entry in its place in the text file. An empty entry consists of the message number, with ? as the message type, and no text. | ||
- | |||
- | The character % has a special meaning when used within the text of a message: | ||
- | |||
- | %0 is placed at the end of a prompt (type P) to prevent DosGetMessage from executing a carriage return and line feed. This allows the user to be prompted for input on the same line as the message text. | ||
- | |||
- | Mike Note: The %0 can be used with any message type!!!! So here is how this works: The message file is scanned, and each is saved. However, if you place a %0 as the last character the <LF> <CR> is dropped and it does not matter the type of message (E, H, I, P, W, or ?). This is how the IBM MKMSGF worked and my clone works the same way. | ||
- | |||
- | %1 - %9 are used to identify variable string insertion within the text of a message. These variables correspond to the Itable and IvCount parameters in the DosGetMessage call. | ||
- | Component-Message Example | ||
- | |||
- | For example, DOS0100E: is DOS error message 100. For additional examples, see the Input Message File Example. | ||
- | Output File | ||
The output file contains the indexed message file that DosGetMessage will use. The output-file name can be any valid OS/2 file name, optionally preceded by a drive letter and a path. The output file cannot have the same name as the input file. | The output file contains the indexed message file that DosGetMessage will use. The output-file name can be any valid OS/2 file name, optionally preceded by a drive letter and a path. The output file cannot have the same name as the input file. | ||
Line 178: | Line 113: | ||
The infile file should have a .TXT extension. | The infile file should have a .TXT extension. | ||
- | The outfile file should | + | The outfile file can have a .MSG or .INC extension. |
Help-message file names begin with the component identifier, followed by H.MSG. For example, the help file associated with the component identifier DOS would be DOSH.MSG. | Help-message file names begin with the component identifier, followed by H.MSG. For example, the help file associated with the component identifier DOS would be DOSH.MSG. | ||
- | Options | + | |
+ | ===== Options | ||
Text-based messages in different code pages can be created using MKMSGF to display errors, help information, | Text-based messages in different code pages can be created using MKMSGF to display errors, help information, | ||
Line 187: | Line 123: | ||
MKMSGF uses the following parameter formats to build message files: | MKMSGF uses the following parameter formats to build message files: | ||
- | MKMSGF infile outfile /Pcodepage | + | |
- | MKMSGF infile outfile /Ddbcsrange or country id | + | MKMSGF infile outfile /Ddbcsrange or country id |
- | MKMSGF infile outfile / | + | MKMSGF infile outfile / |
- | MKMSGF infile outfile /V | + | MKMSGF infile outfile /V |
- | MKMSGF infile outfile /? | + | MKMSGF infile outfile /? |
- | MKMSGF @controlfile | + | MKMSGF @controlfile |
Infile is the ASCII-text source file. | Infile is the ASCII-text source file. | ||
- | + | | |
- | Example: | + | |
- | + | ||
- | MSG | + | |
- | MSG0001I: (mm%4dd%4yy) %2%4%1%4%3 | + | |
- | MSG0002I: (dd%4mm%4yy) %1%4%2%4%3 | + | |
- | MSG0003I: Current date is: %0 | + | |
- | + | ||
- | %0 is a special argument that displays a prompt for user input. | + | |
- | %1 - %9 are the arguments the user can use to insert text in a message. | + | |
- | + | ||
- | | + | |
@controlfile is the message definition file. | @controlfile is the message definition file. | ||
- | Options Summary | + | ===== Options Summary |
- | Type Meaning | + | |
- | /P Code-page ID for the input message file. | + | |
- | /D DbcsRange or country ID for the input message file. | + | |
- | /L Language family ID (one word) and language version ID (one word). | + | |
- | /V Verbose display of message file control variables as the message file is being created. | + | |
- | /? Help display of command syntax for MKMSGF. | + | |
+ | Type Meaning | ||
+ | /P Code-page ID for the input message file. | ||
+ | /D DbcsRange or country ID for the input message file. | ||
+ | /L Language family ID (one word) and language version ID (one word). | ||
+ | /V Verbose display of message file control variables as the message file is being created. | ||
+ | /? Help display of command syntax for MKMSGF. | ||
+ | /A Produce MASM include file using INC file as include file for message constants | ||
+ | /C Produce MASM include file using H file as include file for message constants | ||
+ | /I Include paths | ||
+ | | ||
Note: Any combination of /P, /D, /L, and /V switches can be used for either the command line or @controlfile execution method. | Note: Any combination of /P, /D, /L, and /V switches can be used for either the command line or @controlfile execution method. | ||
The / switch prefix and the - prefix can be used interchangeably when defining switches to MKMSGF. | The / switch prefix and the - prefix can be used interchangeably when defining switches to MKMSGF. | ||
+ | |||
/Verbose Option Output Example | /Verbose Option Output Example | ||
Line 234: | Line 164: | ||
flags = none | flags = none | ||
CP_type | CP_type | ||
- | " | + | |
- | 29 messages scanned. | + | 29 messages scanned. |
- | Size of table entry: word | + | Size of table entry: word |
/P Option | /P Option | ||
Line 247: | Line 177: | ||
/P cannot be used to identify DBCS data. | /P cannot be used to identify DBCS data. | ||
- | |||
- | Mike Note: To the best of my knowledge, and I know little about codepages right now, this option just stores the codepages in the main FILECOUNTRYINFO codepages array. When running MKMSGF for CP 850 and 437 it would be /P 850 /P 437. For example, this is the decompile of the OSO001.MSG from and English system: | ||
- | |||
- | ; Codepage 1 0x352 (850) | ||
- | ; Codepage 2 0x1B5 (437) | ||
/D Option | /D Option | ||
Line 267: | Line 192: | ||
A valid language family with invalid or undefined language version id will cause a default value of 1 to be set for language version. | A valid language family with invalid or undefined language version id will cause a default value of 1 to be set for language version. | ||
- | /A /C /I Options | ||
- | I saw these and documented them as existing years ago, but never really looked at them in depth. I made some notes on a separate page: The A, C, and I Options. | + | |
/E | /E | ||
- | See the The Extended Structure page for more information. This tacks on what I call a fake extended header at the end of the file and updates the header offset. | + | Produce fake extended header. This tacks on what I call a fake extended header at the end of the file and updates the header offset. |
- | Control | + | |
+ | ===== Control | ||
The control file (@controlfile) is used to create multiple-code-page message files. The at sign (@) is not part of the file name, but rather, a delimiter required before a control-file name. | The control file (@controlfile) is used to create multiple-code-page message files. The at sign (@) is not part of the file name, but rather, a delimiter required before a control-file name. | ||
Line 281: | Line 206: | ||
Example: | Example: | ||
- | root.in root. Out /Pcodepage / | + | |
- | sub.001 sub1.out /Pcodepage / | + | sub.001 sub1.out /Pcodepage / |
- | | + | |
- | | + | |
- | sub.00n subn.out /Pcodepage / | + | sub.00n subn.out /Pcodepage / |
The help option (/?) is invalid due to the purpose of the definition file. | The help option (/?) is invalid due to the purpose of the definition file. | ||
Line 291: | Line 216: | ||
Note: Any combination of /P /D /L and /V switches can be used for either the command line or msg_definition_file execution method. | Note: Any combination of /P /D /L and /V switches can be used for either the command line or msg_definition_file execution method. | ||
Input Message File Example | Input Message File Example | ||
- | |||
- | Following is an example of an input message file: | ||
- | |||
- | ; This is a sample of an input | ||
- | ; message file for component MAB | ||
- | ; starting with three comment lines. | ||
- | MAB | ||
- | MAB0100E: File not found | ||
- | MAB0101?: | ||
- | MAB0102H: Usage: del [drive: | ||
- | MAB0103?: | ||
- | MAB0104I: %1 files copied | ||
- | MAB0105W: Warning! All data will be destroyed! | ||
- | MAB0106?: | ||
- | MAB0107?: | ||
- | MAB0108P: Do you wish to apply these patches (Y or N)? %0 | ||
- | MAB0109E: Divide overflow | ||
====== Notes ====== | ====== Notes ====== |