Accessing Files Programmer's Guide (32650-90885)

Chapter 8 123
Writing to a File
Writing Messages to the System Console
.
.
message := 'WRITING A MESSAGE TO THE STANDARD LIST DEVICE.';
message_length := -46 {message is 46 bytes long }
control_code := 0;
PRINT ( message, {message written to $STDLIST }
message_length, {number of bytes in message }
controlcode {set to default }
);
.
.
.
For more information about PRINT parameters, refer to the MPE/iX Intrinsics Reference
Manual. In appendix A, "HP Pascal Program Examples," example A-2 uses the PRINT
intrinsic to write messages to $STDLIST.
Writing Messages to the System Console
Two intrinsics are available that allow you to print a character string directly from your
program to the system console:
PRINTOP transmits an ASCII character string from your program to the system console.
PRINTOPREPLY transmits an ASCII character string from your program to the system
console, and solicits a reply from the system operator.
Writing a message to the system console
Example 8-4 is an HP Pascal/iX program segment that illustrates how your program can
call the PRINTOP intrinsic to transmit a message from a character array in your program to
the System Console.
Example 8-4. Writing a Message to the System Console
.
.
.
var
message : packed array [1..56] of char; {declare PRINTOP parm}
length : shortint; {declare PRINTOP parm}
controlcode : 0..65535; {declare PRINTOP parm}
.
.
.
message := 'Message to Operator'; {message to transmit }
length := -19 {actual length in bytes }
controlcode := 0; {set to default }
PRINTOP ( message,
length,
controlcode
);
.