Returns the printing column position of a printer. Column numbers begin at 0.

Syntax

PCOL( )

Description

Use PCOL( ) to determine the horizontal printing position of a printer—that is, the column at which the printer is set to begin printing. Use PCOL( ) in mathematical statements to direct the printer to begin printing at a position relative to its current column position. For example, PCOL( ) + 5 represents a position five columns to the right of the current position, and PCOL( ) – 5 represents a position five columns to the left of the current position.

When you direct output to the printer, dBASE Plus maps each character according to the coordinate plane, a two-dimensional grid. The coordinate plane is divided into character cells whose widths depend on the value of _ppitch. See the table in the description of _ppitch, which lists _ppitch values. The height of each character cell is determined by the size of the font of the parent form window.

PCOL( ) returns a column number that reflects the current value of _ppitch, regardless of whether you're printing with proportional or monospaced fonts. If you're printing with a proportional font, you can add and subtract fractional numbers to and from the PCOL( ) value to move the printing position accurately.

SET PRINTER must be ON for PCOL( ) to return a column position; otherwise, it returns 0.