Search                        Top                                  Index
HELP CUCHAROUT                                  Revised by Fran Evelyn, July 85

    <character_consumer> -> cucharout

CUCHAROUT is a variable which has as its value a <character_consumer> such as
*CHAROUT (which writes to the terminal). The procedure *PR sends its
output to CUCHAROUT. The default value of CUCHAROUT is CHAROUT. That is,
output normally goes to the user's terminal. To re-direct output to, say, a
disc file named 'foo' then re-assign CUCHAROUT thus:

    discout('foo') -> cucharout;

It is not always necessary for CUCHAROUT to have as its value an output
procedure. For example, to compute the 'print length' of some item one could
use a procedure like that below:

    define prlength(object) -> result;
        define dlocal cucharout(character);
            result + 1 -> result
        enddefine;
        0 -> result;
        pr(object);
    enddefine;

    prlength("cat") =>
    ** 3

CUCHAROUT is reset to CHAROUT by *SETPOP when it resets the system.

See also
HELP *ASCII   - on POP-11 character codes
HELP *CHAROUT - for writing to the terminal
HELP *DISCOUT - to create a character consumer for a disk file
REF *CHARIO   - for more information on character stream I/O
REF *SYSIO    - for more on Input/Output procedures

--- C.all/help/cucharout -----------------------------------------------
--- Copyright University of Sussex 1987. All rights reserved. ----------