PostScript Asserts
This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP
The HqnAssert
procset takes a report string and a procedure, which must return a Boolean. It can be used to provide a lightweight way of checking some aspect of the current configuration in a way that won’t automatically trigger a report in a customer’s production system.
If asserts are enabled (see OverrideAsserts
, below), the procedure is executed. If that returns false
, (i.e., the assertion is incorrect) then the string is printed to stderr
.
/x 1 def
(x is not 0) { x 0 eq } /HqnAssert /ProcSet findresource /HqnAssert get exec
By default, asserts are turned off except in debug RIP builds used internally by Global Graphics or when using the long error checker. To turn on asserts use the OverrideAsserts
call. This takes a Boolean, or a Boolean and a dictionary of options:
true /HqnAssert /ProcSet findresource /OverrideAsserts get exec
or
true <<
/StackCheckTrack true
>> /HqnAssert /ProcSet findresource /OverrideAsserts get exec
At present all of the options control aspects of stack checking.
Note: From Harlequin 13, the “Error Handler – Long” page feature turns on asserts; see Relationship between asserts and the error handler