Function PCol() Foundation
Determines column position of the print head.
PCol() --> nColumn
The return value of PCol() is a positive integer which corresponds to the current print column+1. The first column position is on the left and has the value zero.
The environment function PCol() determines the column position of the print head. The function manages an internal counter which counts the characters sent to the printer. This counter is updated only when the output to the printer occurs due to SET DEVICE TO PRINTER or SET PRINTER ON. The internal counter has the value zero at the start of the program. Following a Carriage-Return (Chr(13)) and the command EJECT, which sends a Form-Feed Chr(12) to the printer, the counter is reset to zero. For any other character, the counter is incremented by one. When a left margin is set with the command SET MARGIN, the internal counter is not set to zero, but to the number of characters of the left margin.
When unprintable characters or control characters (escape sequences) are sent to the printer, the internal counter of PCol() differs from the actual position of the print head. PCol() counts control characters which are interpreted by the printer and not printed. In this case the value of PCol() (and PRow()) must be saved before output so that it can be reset with the function SetPrc() after output of the control characters.
The function PCol() is used along with the function PRow() for formatting the output of forms or tables where the print position is relative to the last position of the print head.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.