xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

MaxCol()

Determines the rightmost column position of the screen buffer.

Syntax

MaxCol() --> nColumn

Return

The function returns the ordinal position of the rightmost column in a console window as a numeric value.

Description

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().

Info

See also:Col(), MaxRow(), Row(), SetMode()
Category: Screen functions
Source:rtl\maxrow.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe