SETMEDIA - ***OBSOLETE*** use SET.MC.

Usage:

setmedia( [unit, ] media );

Options:

The unit number, if not supplied, defaults to the current write unit.

Examples:

extrn wr.mc7;
...
setmedia( 1, 0772 );  /* force printer output in ascii */

Description:

SETMEDIA is used to change the media and/or report code on the file described by "Unit", until it is closed, or until another SETMEDIA is executed for that file.

"Media" is a word with the format:

000000000mrr

where "m" is a single octal digit in the range (0-7) specifying the new media code for this file. "rr" are two octal digits specifying the new report code for further records of this file. A SETMEDIA in the middle of a line forces an end of record.

If "Unit" is not in the range (0-19), or is not an output file, the call is ignored, and a -1 is returned. If all goes well, zero is returned.

Notes:

In order to minimize load module size of the ordinary B program the loading of the routines to write output in media other than 6 is supressed. To drag in the appropriate group of routines one must supply an "extrn wr.mcN;" where N is the desired media code ( 0-7 ).

SETMEDIA can be quite handy for switching report codes, or for writing files, such as object decks, which have records of different media codes. However, it is recommended that, wherever possible, you specify the media code in the original call to OPEN.

See Also:

expl b lib open

expl b lib getmedia

Copyright © 1996, Thinkage Ltd.