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 USING, LPRINT USING Statements
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
PRINT USING writes formatted output to the screen or to a file.
LPRINT USING prints formatted output on the printer LPT1.
 
PRINT [#filenumber%,] USING formatstring$; expressionlist [{; | ,}]
LPRINT USING formatstring$; expressionlist [{; | ,}]
 
    ■ filenumber%       The number of an open sequential file.
    ■ formatstring$;    A string expression containing one or more
                        format specifiers.
    ■ expressionlist    A list of one or more numeric or string expressions
                        to print, separated by commas, semicolons, spaces,
                        or tabs.
    ■ {; | ,}           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:
    a = 123.4567
    PRINT USING "###.##"; a
    LPRINT USING "+###.####"; a
    a$ = "ABCDEFG"
    PRINT USING "!"; a$
    LPRINT USING "\ \"; a$
 
See Also    PRINT, LPRINT    WIDTH