Difference between revisions of "DosPutMessage (FAPI)"

From EDM2
Jump to: navigation, search
(Created page with "==Description== This call outputs the message in a buffer passed by a caller to the specified handle. The function formats the buffer to prevent words from wrapping if display...")
 
m
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
+
{{Legacy
 +
|RepFunc=[[DosPutMessage]]
 +
|Remarks=This function is part of the [[Family API]].
 +
}}
 
This call outputs the message in a buffer passed by a caller to the specified handle. The function formats the buffer to prevent words from wrapping if displayed to a screen.
 
This call outputs the message in a buffer passed by a caller to the specified handle. The function formats the buffer to prevent words from wrapping if displayed to a screen.
  
 
==Syntax==
 
==Syntax==
<PRE>
+
  DosPutMessage (FileHandle, MessageLength, MessageBuffer)
  DosPutMessage
+
  
    (FileHandle, MessageLength, MessageBuffer)
 
 
</PRE>
 
 
==Parameters==
 
==Parameters==
; FileHandle (USHORT) - input : Handle of the output file or device.  
+
;FileHandle (USHORT) - input : Handle of the output file or device.
 
+
;MessageLength (USHORT) - input : Length of the message to be output.
; MessageLength (USHORT) - input : Length of the message to be output.  
+
;MessageBuffer (PCHAR) - input : Address of the buffer that contains the returned message.
 
+
; MessageBuffer (PCHAR) - input : Address of the buffer that contains the returned message.
+
  
 
==Return Code==
 
==Return Code==
rc (USHORT) - return
+
;rc (USHORT) - return:Return code descriptions are:
 +
*0 NO_ERROR
 +
*6 ERROR_INVALID_HANDLE
 +
*19 ERROR_WRITE_PROTECT
 +
*321 ERROR_MR_UN_PERFORM
  
Return code descriptions are:
 
 
* 0        NO_ERROR
 
* 6        ERROR_INVALID_HANDLE
 
* 19        ERROR_WRITE_PROTECT
 
* 321      ERROR_MR_UN_PERFORM
 
 
==Remarks==
 
==Remarks==
 
Screen width is assumed to be 80 characters. The DosPutMessage call counts a CR/LF in the 80 characters that it tries to write to the screen. If a word extends past column 78, it is put on the next line. DosPutMessage assumes the starting cursor position is column one when handling a word wrap.
 
Screen width is assumed to be 80 characters. The DosPutMessage call counts a CR/LF in the 80 characters that it tries to write to the screen. If a word extends past column 78, it is put on the next line. DosPutMessage assumes the starting cursor position is column one when handling a word wrap.
  
If the last character to be positioned on a line is a double-byte character that would be bisected, the rule above ensures that the character is not bisected.  
+
If the last character to be positioned on a line is a double-byte character that would be bisected, the rule above ensures that the character is not bisected.
  
 
+
==Bindings==
==Example Code==
+
===C===
===C Binding===
+
 
<PRE>
 
<PRE>
 
#define INCL_DOSMISC
 
#define INCL_DOSMISC
Line 38: Line 32:
 
USHORT  rc = DosPutMessage(FileHandle, MessageLength, MessageBuffer);
 
USHORT  rc = DosPutMessage(FileHandle, MessageLength, MessageBuffer);
  
USHORT           FileHandle;    /* Handle of output file/device */
+
USHORT FileHandle;    /* Handle of output file/device */
USHORT           MessageLength; /* Length of message buffer */
+
USHORT MessageLength; /* Length of message buffer */
PCHAR           MessageBuffer; /* Message buffer */
+
PCHAR   MessageBuffer; /* Message buffer */
  
USHORT           rc;            /* return code */
+
USHORT rc;            /* return code */
 
</PRE>
 
</PRE>
  
===MASM Binding===
+
===MASM===
 
<PRE>
 
<PRE>
 
EXTRN  DosPutMessage:FAR
 
EXTRN  DosPutMessage:FAR
Line 57: Line 51:
 
Returns WORD
 
Returns WORD
 
</PRE>
 
</PRE>
==Related Functions==
 
*
 
 
  
[[Category:The OS/2 API Project]]
+
[[Category:Dos]]

Revision as of 10:19, 24 November 2019

Att.gif Legacy Function Warning
It is recommended to use a newer replacement for this function.
Replacement: DosPutMessage
Remarks: This function is part of the Family API.

This call outputs the message in a buffer passed by a caller to the specified handle. The function formats the buffer to prevent words from wrapping if displayed to a screen.

Syntax

DosPutMessage (FileHandle, MessageLength, MessageBuffer) 

Parameters

FileHandle (USHORT) - input 
Handle of the output file or device.
MessageLength (USHORT) - input 
Length of the message to be output.
MessageBuffer (PCHAR) - input 
Address of the buffer that contains the returned message.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 6 ERROR_INVALID_HANDLE
  • 19 ERROR_WRITE_PROTECT
  • 321 ERROR_MR_UN_PERFORM

Remarks

Screen width is assumed to be 80 characters. The DosPutMessage call counts a CR/LF in the 80 characters that it tries to write to the screen. If a word extends past column 78, it is put on the next line. DosPutMessage assumes the starting cursor position is column one when handling a word wrap.

If the last character to be positioned on a line is a double-byte character that would be bisected, the rule above ensures that the character is not bisected.

Bindings

C

#define INCL_DOSMISC

USHORT  rc = DosPutMessage(FileHandle, MessageLength, MessageBuffer);

USHORT  FileHandle;    /* Handle of output file/device */
USHORT  MessageLength; /* Length of message buffer */
PCHAR   MessageBuffer; /* Message buffer */

USHORT  rc;            /* return code */

MASM

EXTRN  DosPutMessage:FAR
INCL_DOSMISC      EQU 1

PUSH   WORD    FileHandle    ;Handle of output file/device
PUSH   WORD    MessageLength ;Length of message buffer
PUSH@  OTHER   MessageBuffer ;Message buffer
CALL   DosPutMessage

Returns WORD