$!----------------------------------------------------------------------- $! $! Name : A2PS.COM $! $! Purpose : convert ASCII file to PostScript and print $! $! Arguments : infile, device, orientation $! $! $!--------------------------------------------------------------------- $ ON ERROR Then Goto EXIT $ ON CONTROL_Y Then Goto EXIT $ ascii_to_ps = "$sys$manager:a2ps.exe" $ ! $ verify = f$verify(0) $ set noverify $ say := write sys$output $ say " " $ say " A2PS : file [device] [orientation] $ say " defaults: LASERD portrait $ say " " $ ! $ ! input file name $ ! $ if p1 .eqs. "" then inquire p1 "input file " $ assign/nolog 'p1' infile $ ! $ ! check if input file exists $ ! $ infile := 'f$trnlnm("infile")' $ exist = f$search("''infile'") $ if exist .eqs. "" then goto nofile $ ! $ ! construct a unique file name $ ! $ time = f$time() $ hour = f$extract(12,2,time) $ min = f$extract(15,2,time) $ sec = f$extract(18,2,time) $ file = "plt''hour'''min'''sec'.out" $ ! $ if p2 .nes. "" .and. p2 .nes. "?" .and. p2 .nes. "LASERA" .and.- p2 .nes. "LASERB" .and. p2 .nes. "LASERC" .and. p2 .nes. "LASERD" - .and. p2 .nes. "LASERE" then goto nodevice $ ! $ if p2 .eqs. "" .or. p2 .eqs. "?" $ then $ p2 = "LASERD" $ endif $ say " " $ say "Print file: ''infile'" $ assign/nolog 'file' outfile $ if f$extract(0,1,''p3') .eqs. "L" $ then $ orient = "" $ say "Orientation: landscape" $ else $ orient = "-p" $ say "Orientation: portrait" $ endif $ do_it: $ say " " $ assign/nolog outfile sys$output $ ascii_to_ps -nP -nv "''orient'" 'infile' $ deassign sys$output $ deassign infile $ deassign outfile $! open/append xx 'file' $! write xx "" $! close xx $ if p2 .eqs. "LASERA" $ then $ say "Submit to LASERA " $ print/que=lasera/delete/form=long/nofeed 'file' $ goto exit $ endif $ if p2 .eqs. "LASERB" $ then $ say "Submit to LASERB " $ print/que=laserb/delete/form=long/nofeed 'file' $ goto exit $ endif $ if p2 .eqs. "LASERD" $ then $ say "Submit to LASERD " $ print/que=laserd/delete/form=long/nofeed 'file' $ goto exit $ endif $ if p2 .eqs. "LASERE" $ then $ say "Submit to LASERE" $ print/que=lasere/delete/form=long/nofeed 'file' $ goto exit $ endif $ if p2 .eqs. "LASERC" $ then $ say "Submit to LASERC " $ @sys$manager:titanpr 'file' $ goto exit $ endif $ say " " $ ! $ goto exit $ ! $ ! abnormal exits $ ! $ nofile: $ say " " $ say "File ''infile' does not exist" $ say " " $ goto exit $ nodevice: $ say " " $ say "no such device: ''p2'" $ say " " $ ! $ exit: $ say " " $ ! $ if verify then set verify $ exit $ !