B: ret = set.mc( [unit, ] media );
C: #equate set_mc set.mc int set_mc( [FILE *unit,] int media);
extrn wr.mc7; ... set.mc( 1, 0772 ); /* force printer output in ASCII */
SET.MC is used to change the media and/or report code on the file described by "unit", until the file is closed or until another SET.MC is executed for the file.
In order to minimize the load module size of ordinary B programs, routines to write output in media other than 6 are not normally loaded. To force loading of the appropriate group of routines, one must supply a statement of the form "extrn wr.mcN;" where N is the desired media code (0-7). For media code 10 (card image ASCII) use "wr.m10".
SET.MC 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.
SET.MC should only be called when you have finished outputting a complete record (e.g. after outputting an '*n', '*r' or '*f' character). If you call SET.MC to change media codes while in the middle of a record, the result is undefined.
Copyright © 1996, Thinkage Ltd.