assignfq

assignfq


:startspooler Index Level list-ptr
Syntax assignfq formqueue,device.name{(Unix.command)}{, formqueue,device.name{(Unix.command)}{,...}} {(option}

assignfq ?
Category Spooler
Type Verb
Description assigns a printer device driver to a Spooler formqueue.

This  printer driver is then used by the Output processor (OP), or by FlashBASIC "@" functions to generate special formatting commands like boldface, cursor positioning, or underlining, when output is directed to the spooler.

Using a "?" as a parameter produces brief on-line "help".

Multiple formqueue's can be updated in the command, but each queue must have an associated device name.

Printer drivers are located in the "dm,devices," file. The current driver assignments may be displayed with the "listabs" command.

A printer may have more than one formqueue attached to it. (See the "startptr" command).

On Unix-based implementations, the spooler has the ability to transfer data directly from the Pick process to a Unix-based operation such as a spooler, file, communications link, hardware device, etc.  The relationship between Pick and the Unix process is established by the "assignfq" command.  Simply place the Unix command string in parentheses immediately after the "device.name" field.  Assignfq recognizes the parentheses to mean a Unix process and sets up the proper linkages. (See the "startshp command.)
Options c  "Compiles" devices file item into cursor control block (ccb).
The Cursor Control Block is a binary item, (sort of like a system-level dynamic array) which contains the codes and control strings pertinent to the device in question.  Each system functions ( @(-(n)) ) has its own array position, and the system cursor function searches this item for control strings such as clear-screen, clear to end of screen, etc.
See Also devices assignfq Soft HP LaserJet Printer Fonts on the RS/6000
Example assignfq 3,hp-lzrii

This assigns driver "hp-lzrii" to formqueue 3.

assignfq 3,b(cat>/file1)
sp-assign f3?
Line# Status Copies Form# Device
   7  p          1     3  b(cat>/file1)
list only md (p

The above assignfq command establishes a relationship between the Pick spooler form queue 3 and the Unix process "cat > /file1". Then, the sp-assign command tells the system to attach to form queue 3. Note that the sp-assign is necessary even if the line is already assigned to form queue 3 so that the process is informed that form queue 3 should now output to a Unix command. Finally, the list command will create the Unix file "/file1" with an image of the listing.

The following FlashBASIC program creates a Unix file containing the text "line 1".

execute "assignfq 0,ibm3151(cat>/file1)"
execute "sp-assign f0"
execute "!rm /file1"; * Clear old one out
printer on; * Start printer output
print "line 1"
execute "!ls -l /file1"
printer close; * Close output
execute "!ls -l /file1"
execute "!cat /file1"

The output of the program is:

Assigned form queue device 0, IBM3151(cat>/file1)
-rw-rw---- 1 pick  pick  0 Apr 23 11:15 /file1
-rw-rw---- 1 pick  pick  7 Apr 23 11:15 /file1
line 1

Special attention must be paid to the size of the Unix file. Note the size printed on the Unix "ls" command (0 and then 7). Even after the "line 1" text has been printed, the Unix file size is still zero. Only after the print file has been closed does the output appear in that file (as shown by the new size of 7). Because of this buffering effect, printer jobs must be closed before examining the Unix output.
Warnings The changes created by an assignfq function will NOT take affect for a given line until an sp-assign command is executed on that line. It is recommened that all assignfq commands be incorporated into the system's coldstart macros so that they are automatically set up when the machine boots.

Direct-to-Unix spooling is only available on Unix systems.

The "break" key must not be hit while spooling a job directly to a Unix process as the Unix child process will receive a "kill" signal causing termination of the spool output.

Since direct-to-Unix spooling goes directly out to a Unix command, the "sp-assign" options "o", "h", "i", "d", "c" and "t" are ignored. The "a" and "s" options will still work in this situation.

When printing to Unix, all output is buffered through Unix pipes. Output may not actually enter the Unix command until the Pick process has closed the job or returned to TCL, at which time Pick closes the pipe, forcing Unix to flush the buffer.
Compatibility D3 7.0 AP AP 6.1
:startspooler Index Level list-ptr