[comp.text] Help with LaserWriter Plus/PostScript

ehrlich@psuvax1.UUCP (Dan Ehrlich) (12/17/86)

We just got a couple of LaserWriter Pluses in the department, and being
adventerous tried changing the printer name with the attach PostScript
program.  This always results in the following error showing up in the
log file:

	%%[ Error: undefined; OffendingCommand: setprintername ]%%

From reading in "PostScript Language Reference Manual" the program appears
to be correct.  The "setprintername" command has a dagger after it, along
with a number of other "set*" commands, but I cannot find what the dagger
means.  Any help would be appreciated.  Thanks in advance.

========================= SetPrinterName.PS ===================================
%!
serverdict begin
statusdict begin
0 checkpassword
	{0 exitserver}
	{(Incorrect Server Password!!)= flush stop}
ifelse
(PSU/CS-LaserWriter0) setprintername
end
===============================================================================

--
Dan Ehrlich
Computer Science Department
The Pennsylvania State University
ehrlich@psuvax1.uucp
ehrlich@psuvax1.bitnet

greid@adobe.UUCP (Glenn Reid) (12/19/86)

>We just got a couple of LaserWriter Pluses in the department, and being
>adventerous tried changing the printer name with the attach PostScript
>program.  This always results in the following error showing up in the
>log file:
>
>	%%[ Error: undefined; OffendingCommand: setprintername ]%%
>
>From reading in "PostScript Language Reference Manual" the program appears
>to be correct.  The "setprintername" command has a dagger after it, along
>with a number of other "set*" commands, but I cannot find what the dagger
>means.  Any help would be appreciated.  Thanks in advance.

    The dagger means that you must exit the server loop before
    executing that particular operator.  This is not the problem,
    since you have done that in your example file.

    The problem is that "exitserver" will start a new job, and once
    it is executed, neither serverdict nor statusdict will be present
    on the dictionary stack (This is why you don't need a
    corresponding "end" for "serverdict begin".  Here is a revised
    version of your program which should work correctly:

%!
0000
serverdict begin
statusdict begin
dup checkpassword {
    exitserver
}{
    (      ) cvs print
    ( is not the correct server password.)= flush stop
} ifelse

% here begins a new job, in effect.  Hereafter all definitions will
% remain until the printer is re-booted.
statusdict begin
    (PSU/CS-LaserWriter0) setprintername
end