FUNCTIONS CT

WFCol()

Return the left column of the usable area of the selected window

Syntax

Signature
WFCol( [lRelative] ) --> nCol

Arguments

lRelative

.T. returns the number of columns of the margin between the border of the window and the usable area instead of the screen position. The default is .F.

Return value

The screen column of the left side of the usable area, or with lRelative the left margin.

Description

WFRow(), WFCol(), WFLastRow() and WFLastCol() give the usable area of the selected window, which WFormat() and WBox() make smaller than the window. The margins returned with lRelative can be passed later to WFormat() to set the same usable area again.

Notes

In window 0, the screen, the function gives the area set by WBoard().

Example

WFCol.prg
#if OS_LINUX
   REQUEST GTXWC
#else
   REQUEST GTWVT
#endif

PROCEDURE Main()

   LOCAL nValue, nMargin

   Scroll()
   SetPos( 0, 0 )

   WOpen( 12, 10, 20, 70 )
   WBox()
   DispOutAt( 0, 0, "The usable area starts here" )
   nValue  := WFCol()
   nMargin := WFCol( .T. )

   WSelect( 0 )
   Check( 'WOpen( 12, 10, 20, 70 ), WBox(), WFCol()   ', nValue, 11 )
   Check( 'WFCol( .T. )                               ', nMargin, 1 )
   Check( 'WFCol() in window 0                        ', WFCol(), 0 )
   Check( 'WFCol( .T. ) in window 0                   ', WFCol( .T. ), 0 )

   QOut( "" )
   QOut( "Any key or 10 seconds ends the program" )
   Inkey( 10 )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

See also