| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines the rightmost column position of the screen buffer.
MaxCol() --> nColumn
The function returns the ordinal position of the rightmost column in a console window as a numeric value.
MaxCol() determines the maximum number of columns in a console window in which characters can be displayed. The leftmost column has number zero, the rightmost column has number MaxCol().
| See also: | Col(), MaxRow(), Row(), SetMode() |
| Category: | Screen functions |
| Source: | rtl\maxrow.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// In this example, a box is drawn and column numbers are displayed
// using a different color for every 10th column position.
PROCEDURE Main
LOCAL i
@ 0, 0 TO 2, MaxCol() DOUBLE
FOR i:=1 TO MaxCol()-1
IF i % 10 > 0
@ Row(), Col() SAY Str(i%10,1) COLOR "N/BG"
ELSE
@ Row(), Col() SAY Str(i/10,1) COLOR "GR+/BG"
ENDIF
NEXT
@ 4, 0 CLEAR
RETURN
http://www.xHarbour.com