Share via


Print Method

Prints a character string on a form.

 [FormSet.] Object.Print [(cText, iCurrentX, iCurrentY)]

Parameters

  • cText
    Specifies the character string to print. If you omit cText, a blank line is printed.

    Note

    This method is not supported if BITMAP=OFF.

  • iCurrentX
    Specifies the x-coordinate for printing.

  • iCurrentY
    Specifies the y-coordinate for printing.

Remarks

Applies To: Form | _SCREEN

Thestring is printed on the form, starting at the position specified by the CurrentX and CurrentY properties of the form. When a carriage return is included, CurrentX is increased by the width of cText (same as the value returned by TextWidth) and CurrentY remains unchanged.

When the Print method is finished, the CurrentX and CurrentY properties are set to the point immediately after the last character printed.

Example

The following example defines a form that demonstrates the parameters of the Print method.

CLEAR
PUBLIC x
x=NEWOBJECT("frmSimpleForm")
x.visible=1

DEFINE CLASS frmSimpleForm as Form
   PROCEDURE init
      * generates ctext parameter of strings to print on the form
      * changes currentx and currenty parameters for the strings
      FOR i = 1 TO 10
         IF .t.
            thisform.Print(TRANSFORM(i),20*i,20*i)
         ELSE 
            thisform.CurrentX=20*i
            thisform.CurrentY=20*i
            thisform.Print(TRANSFORM(i))
         ENDIF 
      ENDFOR
ENDDEFINE

See Also

Reference

CurrentX, CurrentY Properties

TextHeight Method

TextWidth Method

Other Resources

Methods (Visual FoxPro)