WRITE Statement


To output data to the screen.


WRITE[list of expressions]


If list of expressions is omitted, a blank line is output. If list of expressions is included, the values of the expressions are output at the terminal. The expressions in the list may be numeric and/or string expressions, and must be separated by commas or semicolons.

When printed items are output, each item will be separated from the last by a comma. Printed strings are delimited by double quotation marks. After the last item in the list is printed, GW-BASIC inserts a carriage return/line feed.

The difference between WRITE and PRINT is that WRITE inserts commas between displayed items and delimits strings with double quotation marks. Positive numbers are not preceded by blank spaces.

WRITE outputs numeric values using the same format as the PRINT statement.


10 A=80: B=90: C$="THAT'S ALL"
20 WRITE A, B, C$
 80, 90, "THAT'S ALL"