Skip to main content
Skip table of contents

HqnContour file writing calls

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP

A number of support procedures are supplied for actually writing to the output file:

[ <one or more objects> fwrite

The fwrite call expects a mark and one or more objects to be written to the file on the operand stack. They are written in order, starting from the one nearest the mark. All objects that are not already strings will be converted to strings using the standard PostScript cvs operator before writing.

fwrite will write a new line at the end of the object series and reset the procset’s view of the current line length to zero.

The MaxLineLen parameter is applied by the fwrite call; the strings supplied may also explicitly include line ends (\n), but care should be taken not to include any lines that MaxLineLen should be applied to in the same call to fwrite.

[ <one or more objects> fstore

The objects supplied are written into the current line buffer, but not actually delivered to the output file. The buffer will be flushed out by the next fwrite or fflush call. Use fstore if you want to include objects in the output but you do not always want a new line in the output file to follow them.

-                                                                   fflush

Flush out a buffer to file that has been stored using fstore.

-                                                                   nl

The nl operator forces a new line in the output file and resets the procset’s view of the current line length.

Do not call nl if data has been stored using fstore and not flushed using fwrite or fflush.

To avoid duplicate line ends you may wish to check that the offset variable is not 0: “offset 0 gt { //nl exec } if”.

[ <two or more objects> delim pushdelims [ obj1 delim obj2 delim obj3 etc

pushdelims inserts the supplied delimiter between each of the supplied objects. Thus:

[ 1 2 3 ( ) pushdelims

would leave the stack as

[ 1 ( ) 2 ( ) 3

This can be useful for grooming a sequence of numbers in preparation for a call to fwrite, for example in the curveto Operator definition.

-                     rflush

Flush out any buffered characters to the OutputFile file.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.