This method lets you put text on a form (or the main Visual FoxPro window).
frmForm.Print( [ cTextToDisplay [ nHorizPos, nVertPos ] ] )The specified text is displayed on the form at the position of CurrentX and CurrentY using the form's ForeColor and Font settings. CurrentX and CurrentY are updated to the end of the string. If cTextToDisplay is omitted, CurrentY increases by the height of a line in the form's font.
The undocumented nHorizPos and nVertPos parameters let you decide where to put the string in VFP 6. They respect ScaleMode, so you can use either pixels or rows and columns.
You can give Print multi-line strings, but they're pretty badly behaved. The second and subsequent lines start at the left-hand edge of the form, regardless of the initial position of CurrentX. The help is either misleading or wrong (hard to tell which) about how multi-line strings affect CurrentX and CurrentY, too. As with single-line strings, CurrentX and CurrentY end up at the ending position of the string.
Strings that don't fit on the form wrap to the next line, kind of like multi-line strings.
On the whole, we'd say to stay away from Print, except for carefully controlled special cases.
_SCREEN.CLS()
_SCREEN.Print("This is a test. ")
_SCREEN.Print("This is only a test.")
_SCREEN.Print()
_SCREEN.CurrentX=200
* The next line will print "Here's a multi-line string" starting
* at position 200, then put "See what happens" at the left-hand
* edge of the next line.
_SCREEN.Print("Here's a multi-line string"+chr(13)+;
"See what happens")
* Try the undocumented position parameters
_SCREEN.Print("I'll position this where I want it",200,475)Cls, CurrentX, CurrentY, ForeColor, FontBold, FontItalic, FontName, FontSize, FontStrikeThru, FontUnderline, ScaleMode
