[Oberon] Re. PSPrinter.Mod

easlab at absamail.co.za easlab at absamail.co.za
Fri Apr 30 18:06:11 CEST 2004


Peter E. wrote:

> There is a LaserJet III here with an HP PostScript 
> cartridge and PSPrinter is installed in ETH Oberon 
> / PC Native 05.01.2003.  A test page prints correctly 
> but then "PROCESSING DATA" continues until "PS 
> ERROR 16".
> 
> The _PostScript Cartridge User's Guide_ explains the 
> error in section 5.8.b.  Quoting briefly, "The 
> control-D must be the last thing sent to the printer."
> I don't really understand the need for the control-D.
> Apparently the newer printers at the ETH don't impose
> this requirement.  In any case, I added the second of
> these three statements in PSPrinter.Close.
> 
> Files.WriteBytes(printR, buffer, bufSize-srcR.res) UNTIL srcR.eof;
> (* End-of-file signal for a LaserJet III with an HP PostScript cartidge. *) 
> IF ~P.eps THEN Files.Write(printR, 4X) END;  (* P. Easthope, 2004-04-29. *)
> IF ~P.anonymous THEN Printer.Spool(P.printF) END;

Without thinking much about it, my first approach would be:
 if it wants a control-D terminator, then give it one, instead
 of modifying the algorithm/code.

Use the unix approach: filter/modify the data to be as the 
 'consumer' wants, instead of reprogramming the 'consumer'.

Here's a case where this cheap hack approach is not possible:
n-o's email client (ver 2001, falsely: because it's not in the RFC) 
assumes that the server's data will be some thing like:
  "you have 9 messages",
and accordingly extracts the first interger value from the 
received data, (char-string) at this stage.
So when eg. the server says: "NovellNet ver 3.0.4b ...",
the client falsely sets-up for 3 messages.


== Chris Glur




More information about the Oberon mailing list