Print Slewing

Overview

Slewing provides a convenient method of moving the print position of the printer vertically downward on the page to a predetermined vertical position.

Vertical tabs, numbered (2, 8), may be set anywhere on a page, and a slew mnemonic, 'S2' through 'S8', may be used to move the paper to the desired tab position.

This part of the section discusses setting the vertical tabs and using the slew mnemonics.

NOTE: Slewing in PRO/5 does not require any matching capability on the printer. Slewing is simulated using linefeeds to move the print position.

Setting the Vertical Tabs

Vertical tabs are set by loading a table that describes the tab positions into PRO/5 virtual Vertical Format Unit (VFU). The VFU is used by the PRO/5 logical printer driver to control the printer. The VFU table is loaded via the 'SL' (start load) and 'EL' (end load) mnemonics. The format of the VFU table is described below.

The VFU table is a string with the following characteristics:

  • The length of the string is equal to the number of lines on the printer paper. For example, a 66-byte string corresponds to paper 66 lines in length.

  • Each byte in the string corresponds to a line on the paper. For example, byte 1 corresponds to the first line, byte 10 to the 10th line, etc.

  • Byte 1 must contain a "1" to indicate the top of form position.

  • For each additional byte, one of the following characters must be selected:

  • Character

    Function

    "0"

    No control operation

    "2"

    Vertical tab 2

    "3"

    Vertical tab 3

    "4"

    Vertical tab 4

    "5"

    Vertical tab 5

    "6"

    Vertical tab 6

    "7"

    Vertical tab 7

    "8"

    Vertical tab 8

    Any of these characters can appear anywhere in the table, and may be repeated any number of times with the exception being that the first byte must be a "1".

    Loading the VFU

    Use the following steps to load the VFU:

    1. Define the VFU table in a string.

    2. OPEN the printer.

    3. Load the VFU by printing 'SL', the start load mnemonic, followed by the VFU string, followed by 'EL', the end load mnemonic.

    4. After the VFU is loaded, PRO/5 assumes that the printer is at top of form.

    For example, if the printer is OPEN on channel 7, and the VFU table is defined in the string variable, A$, the following statement will load the table into the VFU:

    1000 PRINT (7)'SL',A$,'EL'

    In the example above, the string variable, A$, can be replaced by a string constant. For example, the VFU for a paper length of 15 lines and vertical tabs at line 8 and line 13 can be set with the following command:

    1000 PRINT (7)'SL',"100000060000600",'EL'

    NOTE: If the first byte of the VFU table is not a "1" the load results in an error. In this case, the VFU will be reset to the default 66 line form.

    The command PRINT (7) 'SL','EL' disables the VFU control.

    Using the VFU and Slew Mnemonics

    Once the VFU is loaded, printing can be controlled by the slew mnemonics, as well as the form feed ('FF') and vertical tab ('VT') mnemonics. The following rules apply:

    • When PRO/5 encounters a 'FF', it searches the VFU table, starting at the byte corresponding to the current print line, and moving forward until it finds a "1" (cycling back to the first VFU position). PRO/5 counts the number of positions it has skipped in the VFU table and issues that many linefeed characters to the printer.

    • The slew mnemonics have the form 'Sn' where n is an integer in the range (2, 8). When a slew mnemonic is encountered, PRO/5 searches forward in the VFU table until it finds the integer, n, or comes to the end of the table. At the end of the table it cycles through again until it finds the value, n, or is at the starting position. It counts the number of positions it has skipped in the VFU table and issues that many linefeeds to the printer.

    • When a 'VT', vertical tab, is encountered, PRO/5 does the same thing as it does with the 'S6' mnemonic.

    Examples

    The following program illustrates the use of the VFU and slew mnemonics:

    0010 BEGIN
    0015 REM "SET UP A 66 LINE PAGE
    0020 DIM VFU$(66,"0")
    0025 REM "MAKE SURE THERE IS A FF STOP
    0030 LET VFU$(1,1)="1"
    0035 REM "PLACE A STOP AT 10 & 20
    0040 LET VFU$(10,1)="6",VFU$(20,1)="6"
    0050 DIM TEXT$(70,"*")
    0055 REM "OPEN THE PRINTER & LOAD THE VFU
    0060 OPEN (7)"LP"; PRINT (7)'SL',VFU$,'EL'
    0065 REM "WE ARE LOGICALLY AT TOP OF FORM
    0066 REM "SHOW WHERE WE ARE
    0070 PRINT (7)TEXT$,"1"
    0075 REM "DO FIRST SKIP & PRINT SOMETHING
    0080 PRINT (7)'S6',"10"
    0090 PRINT (7)TEXT$,'LF',TEXT$
    0095 REM "SKIP TO NEXT
    0100 PRINT (7)'VT',"20"
    0105 REM "PRINT 2 LINES OF ASTERISKS"
    0110 PRINT (7)TEXT$,'LF',TEXT$,
    0115 REM "LEAVE THE PRINTER AT TOP
    0140 PRINT (7)'FF',; CLOSE (7)

    In this example, the VFU table is set up in the string variable, VFU$. The string is initialized as a string of zeroes, 66 characters long. The top of form is set by putting "1" in the first byte of VFU$. Two vertical stops are then placed at lines 10 and 20.

    The VFU is loaded with the 'SL' and 'EL' mnemonics. Following this, some text is printed and two slew commands are issued. Note how the 'VT' and the 'S6' mnemonics both slew to the same positions in the VFU.