SpoolCmd: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 31: Line 31:
NOTE: The spoolfile created by Business Rules will not automatically be deleted.
NOTE: The spoolfile created by Business Rules will not automatically be deleted.


On DOS and Windows, if [[CONFIG]] SPOOLCMD is not specified, opens to PRN: will return error [[6298]] if the printer is not ready.
On DOS and Windows, if [[CONFIG]] SPOOLCMD is not specified, it opens to PRN: and will return error [[6298]] if the printer is not ready.


 
SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The new SPOOLCMD syntax is:
SPOOLCMD now supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The new SPOOLCMD syntax is:


   SPOOLCMD [@] [-w] command  parm-1 parm-2 ...
   SPOOLCMD [@] [-w] command  parm-1 parm-2 ...


SPOOLCMD now honors BR drive substitution on the command itself, for example:
SPOOLCMD honors BR drive substitution on the command itself, for example:
   DRIVE  J:,M:\myapp,j,\
   DRIVE  J:,M:\myapp,j,\
   SPOOLCMD J:\mylib\spooler [SPOOLFILE] [COPIES]
   SPOOLCMD J:\mylib\spooler [SPOOLFILE] [COPIES]

Revision as of 18:02, 8 April 2013

Also see the PRINTING chapter.

Basically, SpoolCmd provides a description of how to print data sent to the printer.

Business Rules supports independent spoolers on all systems. The BRConfig.sys SPOOLCMD specification will make a shell call to issue the necessary spool command whenever printing is done. When this is invoked the spooler is responsible for removing the spool file created by Business Rules.

The spool command and its parameters can be specified in a CONFIG command or in the BRConfig.sys file as follows:

Business Rules can also make substitutions as follows in parameters specified with SPOOLCMD:

[SPOOLFILE] substitutes the name of the spool file, as determined by Business Rules.

[NAME=] substitutes the name of the printer file as specified in the OPEN display statement's NAME= string. For example, PRN:/10.

[QUEUE] substitutes the queue name as specified in the OPEN display statement. In the following example, "queue" would be substituted for [QUEUE]: PRN:queue/10.

[PRINTER] substitutes the "printerclass" string as specified in the OPEN display statement. For example, PRN:/printerclass.

[WSID] substitutes the workstation ID as specified at start-up or by the BRConfig.sys WSID spec.

[PROGRAM] substitutes the name of the program that is loaded at the time that the printer is closed.

The [QUEUE] and [PRINTER] parameters can be used almost interchangeably. They are simply a versatile way to pass specifications from the Open (or SUBSTITUTE) statement to the spooler.

The following is an example of the SPOOLCMD specification used with the WBSPOOL utility (see WBSPOOL.EXE in the Other Changes/Enhancements section for more information:)

SPOOLCMD wbspool -Q[PRINTER] -E [&ERRNO][SPOOLFILE]

NOTE: The spoolfile created by Business Rules will not automatically be deleted.

On DOS and Windows, if CONFIG SPOOLCMD is not specified, it opens to PRN: and will return error 6298 if the printer is not ready.

SPOOLCMD supports the -w flag which avoids the use of a DOS shell command when calling Windows applications directly. The new SPOOLCMD syntax is:

  SPOOLCMD [@] [-w] command  parm-1 parm-2 ...

SPOOLCMD honors BR drive substitution on the command itself, for example:

 DRIVE  J:,M:\myapp,j,\
 SPOOLCMD J:\mylib\spooler [SPOOLFILE] [COPIES]

This finds 'spooler' in M:\myapp\mylib.

See also: