Win32Prn() > Print output methods xHarbour Developers Network  

oWin32Prn:textOut()

Prints text at the current print position.

Syntax

:textOut( <cString>]    , ;
         [<lNewLine>]   , ;
         [<lUpdatePosX>], ;
         [<nTexAlign>]    ) --> lSuccess

Arguments

<cString>
This is a character string holding the text to print.
<lNewLine>
This parameter defaults to .F. (false). When set to .T. (true), the print position is moved to the beginning of the next line after <cString> is output.
<lUpdatePosX>
This parameter defaults to .T. (true) which changes the X coordinate of the print position to the end of <cString> after printing. Subsequent print output appears to the right of <cString>. Passing .F. (false), leaves the X coordinate unchanged.
<nTextAlign>
This is an optional numeric value specifying the text alignment at the current print position. The following values can be used:

Values for text alignment
ValueDescription
0 *)Text is printed left aligned to the current print position
 1Text is printed right aligned to the current print position
 2Text is printed centered on the current print position

Description

Method :textOut() is the most commonly used one for printing text strings. It uses the current :setFont() and :setColor() settings, and updates the X coordinate of the print position by default. The method does not wrap text to a new line when the output exceeds :rightMargin. Use method :getTextWidth() to determine if <cString> still fits into the current line. For example:

   IF ::posX + ::getTextWidth( <cString> ) > ::rightMargin
      ::newLine()
   ENDIF

The method returns a logical value indicating success of the operation.


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