[REBOL] Re: Printing in REBOL
From: al:bri:xtra at: 16-Jan-2001 7:34
> It works fine but I have a few problems:
> 1) My printer is on %//lpt1, I've modified the program and it still works
prn I believe is diverted automatically to the first available printer. Or
so I had believed?
> 2) The << throw-on-error >> is undocumented and it doesn't seem to work.
You might need to update your Rebol? See:
>> help throw-on-error
Evaluates a block, which if it results in an error, throws that error.
THROW-ON-ERROR is a function value.
blk -- (Type: block)
You can delete delete 'Throw-on-error (and the square brackets) if it's not
> If I take my printer off-line it hangs up REBOL until I fix the problem.
If I leave the printer as %//prn it goes back to command line. Is that what
the function is suppose to do?
What do you mean by "it" in "it goes back to command line"? The function
returns the text it was given?
> 3) I understand this part of the code << secure [
> %//prn [allow write]
> ] >> to mean that it should write automatically without asking, but the
program still ask for permission.
Rebol asks if it can lower the security level, which is the 'secure word
> 4) Where did you get the codes for the printer?
>From studying a book on serial communications, I knew that the form feed
code feeds a new page. The codes are described in the Rebol/Core PDF manual.
I append a CR code to cover cases where the last line hasn't got a newline
at the end or if Rebol doesn't convert newlines to CR/LF for Windows on
writing to a port, or if the printer doesn't formfeed correctly.
I hope that helps!
ICQ: 26227169 http://members.nbci.com/AndrewMartin/