QBasic 1.1: PRINT USING Statement


PRINT [#filenumber%,] USING formatstring$; expressionlist [{; | ,}]
LPRINT USING formatstring$; expressionlist [{; | ,}]

Description / Parameter(s)

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.
Format Specifiers:
Characters that format a numeric expression
#Digit position.
.Decimal point position.
,Placed left of the decimal point, prints a comma every third digit.
+Position of number sign.
^^^^Prints in exponential format.
-Placed after digit, prints trailing sign for negative numbers.
$$Prints leading $.
**Fills leading spaces with *.
**$Combines ** and $$.
Characters used to format a string expression
&Prints entire string.
!Prints only the first character of the string.
\  \Prints first n characters, where n is the number of blanks between slashes + 2.
Characters used to print literal characters
_Prints the following formatting character as a literal.
 Any character not in this table is printed as a literal


a = 123.4567 PRINT USING "###.##"; a LPRINT USING "+###.####"; a a$ = "ABCDEFG" PRINT USING "!"; a$ LPRINT USING "\ \"; a$