en:docs:tk:formats:msgsrc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:tk:formats:msgsrc [2024/01/19 15:49] – created prokusheven:docs:tk:formats:msgsrc [2026/05/28 06:23] (current) – [Component Identifier Line] prokushev
Line 1: Line 1:
-===== Input Message File Format =====+====== Input Message File Format ======
  
-The input message file is a standard ASCII file that contains three types of lines:+The input message file is a standard ASCII file containing three types of lines:
  
-    Comment lines +  * Comment lines 
-    Component identifier line +  Component identifier line 
-    Component message lines+  Component message lines
  
-Comment Lines+===== Comment Lines =====
  
-Comment lines are allowed anywhere in the input message fileexcept between the component identifier and the first message. Comment lines must begin with a semicolon (;) in the first column.+Comments may appear anywhere in the file **except** between the component identifier line and the first message line  
 +A comment line must begin with a semicolon ('';'') in the first column.
  
-In the Input Message File Example, the comment lines are+Example
 +<code> 
 +; This is a sample of an input 
 +; message file for component DOS 
 +; starting with three comment lines
 +</code>
  
-  ; This is a sample of an input +===== Component Identifier Line =====
-  ; 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.+A single line holding the threecharacter component identifier. This identifier is prefixed to all message numbers.
  
-In the example, the component identifier is DOS. +In the example, the identifier is ''DOS''.
-Component-Message Lines+
  
-Each component-message line consists of a message header and an ASCII text message.+===== Component Message Lines =====
  
-The message header is comprised of the following parts:+Each message line consists of a **message header** followed by the ASCII text of the message.
  
-    A three-character component identifier +==== Message Header ====
-    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:+The header is composed of the following fields, written contiguously:
  
-  Type Meaning +  - Three‑character component identifier (e.g., ''DOS''). 
-  E Error +  - Four‑digit message number (e.g., ''0100''). 
-  H Help +  - A single character indicating the message type (see table below). 
-  I Information +  - A colon (':'). 
-  P Prompt +  - A single blank space separating the header from the message text.
-  W Warning +
-  ? no message assigned to this number+
  
-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.+**Format:** ''COMPNNNNT: message text''
  
-The character % has a special meaning when used within the text of a message:+==== Message Types ====
  
-%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.+^ Code ^ Type        ^ Meaning                                      ^ 
 +| E    | Error       | Error message                                | 
 +| H    | Help        | Help text                                    | 
 +| I    | Information | Informational message                        | 
 +   | Prompt      | Prompt (user input expected)                 | 
 +| W    | Warning     | Warning message                              | 
 +| ?    | (unused)    | Placeholder for a number with no 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.+==== Numbering and Placeholder Entries ====
  
-%1 - %9 are used to identify variable string insertion within the text of messageThese variables correspond to the Itable and IvCount parameters in the DosGetMessage call.+  * Message numbers may start at any value, but **must appear in strictly ascending sequential order** in the file. 
 +  * When particular number is not used, a placeholder entry is requiredA placeholder consists of the full header with the type ''?'' and **no message text** after the colon and blank 
  
-Component-Message Example+Example: ''MAB0101?:''
  
-For example, DOS0100E: is DOS error message 100. For additional examples, see the Input Message File Example.+===== Special Characters in the Message Text =====
  
 +The percent sign (''%'') has special meaning when used inside message text.
 +
 +==== Suppressing the Trailing Newline (''%0'') ====
 +
 +If the sequence ''%0'' appears as the very last characters of a message text, the ''DosGetMessage'' API will **not** append a carriage return and line feed (CR+LF). This is typically used for prompts so that user input can follow on the same line.  
 +
 +==== Inserting Variable Strings (''%1'' – ''%9'') ====
 +
 +Sequences ''%1'' through ''%9'' mark positions where variable strings are inserted at runtime. The actual values are provided via the ''Itable'' and ''IvCount'' parameters of the ''DosGetMessage'' call.
 +
 +Example: the message ''%1 files copied'' will have ''%1'' replaced by an appropriate string (e.g., a number of files).
 +
 +===== Complete Input File Example =====
 +
 +<code>
 +; 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:][path] filename
 +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
 +</code>
 +
 +  * ''MAB'' – component identifier.
 +  * ''MAB0100E'' – error message.
 +  * ''MAB0101?'' – placeholder for an unused number.
 +  * ''MAB0104I'' – informational message with variable insertion (''%1'').
 +  * ''MAB0108P'' – prompt with ''%0'' to suppress the trailing newline.