Skip to main content
Skip table of contents

AddAutoExecType in the HqnControl procset

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

Just as AddExecType is used to add the definition of a new file type which cannot be automatically identified, AddAutoExecType is used to add the definition of a new file type which can be automatically identified.

It takes a key and an array of two procedures as its arguments. The key will be used as the new file type identifier. The first procedure in the array is used to determine whether a specific file is of this type. The second procedure will be used to execute the file if it is positively identified.

The identification procedure will be called with a file name and a file object on the operand stack. These objects must not be consumed, and the procedure must add to the stack a Boolean, which should be true if the file is of the type in question and false otherwise. The procedure may change or replace the file object, but only if the file is positively identified as being of this type. The procedure should also explicitly return the file pointer to the start of the file before returning. If the identification procedure needs to store variables, then they should be explicitly put into appropriate dictionaries, or the procedure must create and save variables within a temporary dictionary.

The execution procedure will be called with a file object on the operand stack, which it is expected to consume. In many cases the file may be executed by calling an input plugin which provides a PostScript filter.

            /MyType [
                      dup 4 string readstring pop (ABCD) eq
                      1 index 0 setfileposition
                  } bind
                    /MyFileDecode filter cvx exec
                  } bind
            /HqnControl /ProcSet findresource /AddAutoExecType get exec

If a file type added here uses the same name as one of the file types supplied by GGS then it will be used in preference to the standard identification and execution procedures. If, however, the replacement identification procedure does not positively identify the file, but the standard, GGS supplied, identification procedure does, then the GGS execution procedure will be used to execute it.

JavaScript errors detected

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

If this problem persists, please contact our support.