2015-08-02 12:12:44 +00:00
|
|
|
|
The {{KW|WRITE}} statement writes a [[comma]]-separated list of values to the screen without spacing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
|
|
|
|
:{{KW|WRITE}} [{{Parameter|expression, List}}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{PageDescription}}
|
|
|
|
|
* {{Parameter|expressionList}} is a comma-separated list of variable or literal values to be written to the screen.
|
|
|
|
|
* Write statement separates displayed values using [[comma]] separators(required) that will display on the screen.
|
|
|
|
|
* Leading and trailing number spaces are omitted when displaying numerical values.
|
|
|
|
|
* [[STRING|String]] [[quotation mark]]s will also be displayed.
|
|
|
|
|
* [[Semicolon]]s cannot be used in or following the WRITE statement!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
''Example:'' Comparing WRITE to the same PRINT statement.
|
|
|
|
|
{{CodeStart}}a% = 123
|
2019-04-15 01:15:33 +00:00
|
|
|
|
b$ = "Hello"
|
2015-08-02 12:12:44 +00:00
|
|
|
|
c! = 3.1415
|
|
|
|
|
|
|
|
|
|
{{Cl|PRINT}} a%, b$, c! 'commas display tab spaced data
|
|
|
|
|
{{Cl|WRITE}} a%, b$, c! 'displays commas between values, strings retain end quotes
|
|
|
|
|
{{CodeEnd}}
|
|
|
|
|
{{OutputStart}}
|
|
|
|
|
123 Hello 3.1415
|
2019-04-15 01:15:33 +00:00
|
|
|
|
123,"Hello",3.1415 '' ''
|
2015-08-02 12:12:44 +00:00
|
|
|
|
{{OutputEnd}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
|
|
|
* [[WRITE (file statement)|WRITE #]]
|
|
|
|
|
* [[INPUT (file statement)|INPUT #]]
|
|
|
|
|
* [[PRINT]], [[PRINT (file statement)|PRINT #]]
|
|
|
|
|
* [[PRINT USING]]
|
|
|
|
|
|
|
|
|
|
|
2019-04-15 01:15:33 +00:00
|
|
|
|
{{PageNavigation}}
|