The LazyBoy Library Manual - WriteAssign

Part of the Text Writer group.

%imacro WriteAssign 1-2
Prefers: word
Prefers: BX
Prefers: ES:DI, CX

Changes the Text Writer output device.

The output of text written using Write and WriteLn can be set using the WriteAssign macro. At program startup, this is automatically set to the wdCRT as long the CRT functions have not been excluded. If NO_CRT has been defined, it will be set to wdCONSOLE instead.

When changing the output device, use the constants and not the values. They are easier to read and the actual values may change in future versions.

WARNING: You should not write to the screen using any of basic the DOS or BIOS functions when the CRT functions are included. Doing so can have unpredictible visual results. Such as text being display in incorrect location or numerious other visual artifacts. The DOS and BIOS output is still available for the support of things like I/O redirection. Write and WriteLn have no such restrictions.

Predefined device constants:

wdNULLinternal no output device
 
wdTELETYPEBIOS Teletype device
wdCONSOLEDOS Standard output device using a file handle.
wdSTDOUTalias of wdCONSOLE.
wdERRORDOS Error device using file a handle.
wdAUXDOS Auxiliary device using a file handle.
wdPRINTERDOS Printer device using a file handle.
 
wdCRTCRT display device. CRT fuctions must not be excluded with the NO_CRT define.
 
wdMEMORYMostly internal usage in writing to buffers. However, it can be used with library File operations.
 
(other value)output to file handle.

Examples:

    WriteAssign  wdCONSOLE      ; send text to DOS Standard Output
    WriteAssign  wdCRT          ; send text through CRT functions
    WriteAssign  bx             ; send text to file handle BX
    WriteAssign  ds:si, 64      ; send text to a memory buffer at ds:si. The
                                ; buffer is 64 bytes. Which supports a total
                                ; of 63 characters + an ASCIIZ terminator.
                                ; Also, set write position in buffer to 0.

See also Write, WriteLn and the File macro group.