%include "CONSTS" %include "FORMS" %include "SEG7" %include "PROCS" %external %routine FLUSH OUT %alias "IO$FLUSH" %return %if S7_outx == null %if S7_outx_type = char type %start;! Set up length to be written S7_outx_len = S7_outx_buffp - S7_outx_buffad %else; ! File - create or append? %if S7_outx_block = 0 %start; ! Doesn't yet exist - open temp S7_outx_file_fname(1) = S7_outx_file_fname(1)!128 dir fn (S7_outx, destroy); ! Throw away old temp, if any. dir fn (S7_outx, create); ! Make new temp (returns 1st block no) %else dir fn (S7_outx, append); ! Find new disk block %finish %signal 9, 3, disc full %if S7_p_a = 0; ! No room on disk (or in Dir.) %finish dev fn (S7_outx, write fn); ! Write to device or disk %if S7_outx_type = file type %start %signal 9, 3, disc flt %if S7_p_a # 0; ! Failed to write set EOT (S7_outx_buffad); ! Set up disk buffer to EOT %finish S7_outx_buffp = S7_outx_buffad; ! Buffer now empty %end %end %of %file