![]() |
<< Index >> |
FutureBasic 5 |
statement | ||
|
print [@(col,row)|%(h,v)][printItem [{,|;}[printItem]...]]
print [@(col,row)|%(h,v)][Point [{,|;}[Point]...]]
route
'd device. The text is printed using the window's or printer's current font ID, font size, text style, text mode and foreground color (see the text
, color
and long color
statements). The parameters are interpreted as follows:dim mousePos as Point
call GETMOUSE(mousePos)
print mousePos
(194x,167y)
@(col,row)|%(h,v)
@(col,row)
variant, then col
and row
represent the text column and row where the first character should appear; the exact pixel location depends on the current font ID and font size. If you use the %(h,v)
variant, then h
and v
represent horizontal and vertical pixel positions; the first printed character is positioned with its lower-left corner at point (h,v)
. If you don't specify either variant, printing begins at the window's or printer's current pen position.printItem
printItem | Description |
a string expression | The string is printed. If the string includes a carriage-return character (ASCII character 13), the character causes the pen to move down to the beginning of the next line. |
a numeric expression | The decimal value of the number is printed. A space character is always printed after the number; if the number is non-negative, a space character is also printed before the number. FutureBasic formats the number in a reasonable way; if you need the number to appear in a special format, use string functions such as Using, Hex$, Str$, etc. |
a Pointer or Handle variable | The variable's value is interpreted as an address, which is then printed as a numeric expression (see above). |
Tab(position) | Sufficient space characters are printed until the current line contains position -1 characters. (If there are already more than position -1 characters on the line, Tab does nothing.) This is usually done to help line up several lines of text into neat columns. Note that this effect looks best if you're using a monospaced font. |
Spc(numSpaces) | numSpaces space characters are printed. This has the same effect as printing the string expression Space$(numSpaces). |
{,|;}
printItem
's; you can also optionally put a comma or semicolon at the end of the print
statement (following the last printItem
).printItem
's.printItem
's. Use this when you want printItem
's to be printed as close together as possible.print
moves the pen down to the beginning of the next line after the last printItem
is printed. However, if you put a comma or a semicolon at the end of the print
statement, the pen remains to the right of the last printItem
, and is not moved down to the next line. This allows you to continue printing on the same line using a subsequent print
statement.print
without any parameters, like this:print
printItem
's reach the right edge of the window or the printer page, the print
statement automatically "wraps the line"; that is, it moves the pen down to the beginning of the next line to continue printing the remaining printItem
's. However, this behavior can be altered using the width
statement; see the width statement for more information.print
statement causes the pen to move below the bottom of the window, the window's contents are scrolled up so that the newly printed text will be visible.print
statement causes the pen to move below the bottom of the printer page, the page is ejected and printing continues at the top of the next page.print
statement is not automatically refreshed, unless you're using the "FB Lite" runtime. To display text which is automatically refreshed, consider using Edit Fields (see the edit field statement).