Xref: utzoo comp.sys.amiga:40147 comp.lang.rexx:77 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!gem.mps.ohio-state.edu!apple!sun-barr!newstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga,comp.lang.rexx Subject: Useful rexx script Keywords: print a file Message-ID: <124802@sun.Eng.Sun.COM> Date: 15 Sep 89 19:30:34 GMT Sender: news@sun.Eng.Sun.COM Followup-To: comp.sys.amiga Lines: 40 This is a useful REXX script I've been using to print out files. If you have WShell (Bill Hawes replacement for the Amiga shell) you can put it in rexx: and just type printfile from the prompt. Otherwise, you will need to type rx "printfile filename" to use it. --Chuck /* Rexx script */ /* printfile.rexx will print a text file on the printer with headers */ say "Printing File" WORD(ARG(1),1) if open('Source',WORD(ARG(1),1), 'Read') ~= 1 then do say "File not found." exit end outfile = "PRT:" if WORDS(Arg(1)) > 1 then outfile = Words(ARG(1),2) if open('Printer',outfile,'Write') ~= 1 then do say "Can't open destination." exit end i = 0 page = 1 do while EOF('Source') ~= 1 if i = 0 then do e = writeln('Printer','0c'x); e = writeln('Printer', ARG(1) " Page " page); e = writeln('Printer', '0a0a0a'X); page = page + 1 end line = Readln('Source') e = writeln('Printer', line) i = (i + 1) // 50 end --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you. "If I were driving a Macintosh, I'd have to stop before I could turn the wheel."