Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Printing with Rebol on Windows network

From: al:bri:xtra at: 22-Aug-2002 19:44

Andrew wrote:
> > Note that Windows printers require CR and LF to be sent for the end of
line; newline. If you must print directly from Rebol, you'll need to replace/all of the newline values in your text with these values. Louis wrote:
> How are you doing this?
At the moment, by doing something like this: Pages: rejoin [ ; A whole lot of lines... "Blah blah blah..." newline "^(page)" ; Page feed code. ; A whole lot of lines... "Blah blah blah..." newline "^(page)" ; Page feed code. ] ; Rebol converts 'newline to CRLF automatically in 'write. write %Test.txt Pages ; ...and then print to printer: write/binary %//prn read/binary %Test.txt I'm using the above method at the moment, because I'm still testing and writing reports. A better method that doesn't use the temporary file is something like: replace/all Pages newline CRLF write/binary %//prn Pages Caution: I haven't tested the above script! Brian wrote:
> write/with %somefile "somedata" "^M^/"
I hadn't thought of that method. That's a good method if one's using a non-windows PC on the network.
> or you could use "^(0D)^(0A)", it means the same thing.
Rebol has defined CRLF as:
>> crlf
== "^M^/" I hope that helps! Andrew Martin ICQ: 26227169 http://valley.150m.com/