Sets the printing column position of a printer, which is the value of PCOL( ).

Syntax

SET PCOL TO <expN>

<expN>

The column number to which to set PCOL( ). The valid range is 0 to 32,767, inclusive.

Description

Use SET PCOL to set the horizontal printing position of a printer, which is the value the PCOL( ) function returns. Generally, you use the command SET PCOL TO 0 to reset the printer column to the left edge of the page.

When you move the printing position to a new line, dBASE Plus reinitializes PCOL( ) to 0, so SET PCOL affects the value of PCOL( ) for the current line only. When you send output to your printer, dBASE Plus updates PCOL( ) by adding 1 to the current PCOL( ) value for each character it sends to the printer. The printing position moves one column for each character the printer prints.

When you send a printer control code or escape sequence to your printer, the printing position doesn't move. (Printer control codes and escape sequences are strings that give the printer instructions, such as to print underlining, boldface type, or different fonts.) Although control codes and escape sequences don't move the printing position, dBASE Plus nonetheless increments the PCOL( ) value by the number of characters that you send to the printer. Each control code character increments the value of PCOL( ) by 1 just like any other character. As a result, the value of PCOL( ) might not reflect the actual printing position. Use SET PCOL to reset the value of PCOL( ) to the same value as the printing position.

To send a control code to the printer without changing the value of PCOL( ), save the current value of PCOL( ) to a memory variable, send the control code to the printer, then SET PCOL to the contents of the memory variable.