home *** CD-ROM | disk | FTP | other *** search
- /*
- * Script to send monitor a stream and send an IXO page on success.
- *
- * Copyright 1992, Mike W. Meyer
- * All Rights Reserved
- *
- * This filters pages out of it's standard input stream. The only argument
- * is "multi", which causes multi-page messages for long messages.
- */
- debug = 0 /* set to 1 to enable debugging messages */
- if ~debug then trace Background
-
- /* argument processing */
- parse arg dest format
- if dest = "" then do
- say "no destination specified"
- exit
- end
-
- if strip(format) = "" then format = "line"
-
- /* Arrange things so signals send us somewhere reasonable */
- signal on error
- signal on ioerr
- signal on halt
- signal on syntax
-
- /* Spin, watching stdin */
- do until eof(stdin)
- line = readln(stdin)
- out = builddata(format)
- if out ~= "" then
- if debug then say dest out
- else address command 'spoolpage' dest 'message' out
- end
- exit
-
- /* Catch errors and exit in that mode */
- error:
- ioerr:
- halt:
- syntax:
- status = "Unexpected error:" rc "at line:" sigl
- if debug then say status
- else address command 'spoolpage' dest 'message' status
- exit 20
-
- /* create a lexical scope with only the advertized variables visible. */
- builddata: procedure expose line
- interpret "return" arg(1)
-