LPRINT FLUSH statement

Purpose

Flush any remaining print data to a printer device and signal the start of the print process.

Syntax

LPRINT FLUSH

Remarks

LPRINT FLUSH forces the operating system to flush any buffered data and begin printing.  Use LPRINT FLUSH to ensure print data is submitted to the printer as soon as possible, rather than waiting for any timeout period to elapse first.  Depending upon the printer and its drivers, printing may begin immediately, or it may be delayed until execution of an LPRINT CLOSE statement.

Typically, an LPRINT FLUSH statement is preceded with a FORMFEED statement, so ensure that the print job is ejected normally from the printer device.

See also

LPRINT, LPRINT ATTACH, LPRINT CLOSE, LPRINT FORMFEED, LPRINT$, XPRINT, XPRINT ATTACH

Example

' Typical LPRINT printing strategy

ERRCLEAR

LPRINT ATTACH "LPT2" ' Use LPT2 device

IF ISTRUE ERR OR ISFALSE LEN(LPRINT$) THEN

  LPRINT "This is your line-printer talking"

  LPRINT FORMFEED      ' Issue a formfeed

  LPRINT FLUSH         ' flush the buffer

  LPRINT CLOSE     ' detach the printer

END IF