Purpose |
Output text to be printed on the selected printer. | ||||||||||
Syntax |
XPRINT PRINT [EXPRLIST] [POS(n)] [SPC(n)] [TAB(n)] [,] [;]... XPRINT [EXPRLIST] [POS(n)] [SPC(n)] [TAB(n)] [,] [;]... | ||||||||||
Remarks |
Prior to any XPRINT operations, you should be certain that a printer has been selected with XPRINT ATTACH. The text foreground and background color are set with XPRINT COLOR. Text which extends beyond the bounds of the page is clipped. The size of the text to be printed can be determined in advance with XPRINT TEXT SIZE, and formatted to fit a particular field with XPRINT SPLIT. Drawing begins at the last point referenced by another statement, or the point specified by XPRINT SET POS. The upper left corner of the text is positioned at the POS. XPRINT PRINT has the following parts, which may occur in any order and quantity, within a single statement:
If the final argument is a semicolon or comma, the POS is maintained at the current location, rather than the default action of moving to the start of the next line. For example: XPRINT PRINT "Hello"; XPRINT PRINT " world!"; ...produces the contiguous result "Hello world!" If you omit all arguments, XPRINT PRINT just moves the POS to the left margin of the next line. Any control codes, such as Carriage Return, Line-Feed, and Backspace are not interpreted. They will display as symbols in the current selected font. USING$ is a separate function, which may be included in the ExprList. See the USING$() function for more information. It is not possible to print a User-Defined Type (UDT), a Variant, an object variable, or an entire array. Individual member values must be extracted with the appropriate function before they can be displayed. | ||||||||||
See also |
FONT NEW, LPRINT, XPRINT ATTACH, XPRINT CELL, XPRINT CHR SIZE, XPRINT COLOR, XPRINT CLOSE, XPRINT SET FONT, XPRINT GET POS, XPRINT SET POS, XPRINT SET WORDWRAP, XPRINT SET WRAP, XPRINT SPLIT, XPRINT TEXT SIZE | ||||||||||
Example |
' Typical XPRINT printing strategy ERRCLEAR XPRINT ATTACH DEFAULT ' Use default printer IF ERR = 0 AND LEN(XPRINT$) > 0 THEN XPRINT "This is your printer talking" XPRINT FORMFEED ' Issue a formfeed XPRINT CLOSE ' detach the printer END IF |