qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PRINT, LPRINT Statements
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
PRINT writes data to the screen or to a file.
LPRINT prints data on the printer LPT1.
 
PRINT [#filenumber%,] [expressionlist] [{; | ,}]
LPRINT [expressionlist] [{; | ,}]
 
    ■ filenumber%       The number of an open file. If you don't specify a
                        file number, PRINT writes to the screen.
    ■ expressionlist    A list of one or more numeric or string expressions
                        to print.
    ■ {; | ,}           Determines where the next output begins:
                          ; means print immediately after the last value.
                          , means print at the start of the next print zone.
                            Print zones are 14 characters wide.
 
Example:
    OPEN "TEST.DAT" FOR OUTPUT AS #1
    PRINT #1, USING "##.###  "; 12.12345
    CLOSE
    OPEN "TEST.DAT" FOR INPUT AS #1
    INPUT #1, a$
    PRINT a$
    LPRINT "This is a line"; 1
    LPRINT "This is a line",
    LPRINT 2
 
See Also    PRINT USING, LPRINT USING    WIDTH    WRITE