Toshiba KB-80 Computer Keyboard User Manual


 
- 58 -
When a comma (,), semicolon (;), or space is placed at the beginning of the string,
carriage return and line feed are included in the character string, and the output can
be performed by the PRINT statement. However, when the data is read by the
INPUT# statement later, commas, semicolons, carriage returns and line feeds are
regarded as delimiters, and a space placed at the beginning of the string is ignored.
To prevent the above, double quotation mark (”) (CHR$ (34)) should be added before
and after each character string.
Ex.) A$=”CAMERA, AUTOMATIC”, B$=”93604-1”
PRINT #1,A$;B$
If the statement is described as above, the data is written to the file as follows.
CAMERA, AUTOMATIC 93604-1
And “CAMERA” and “AUTOMATIC 93604-1” are assigned to A$ and B$, respectively
by the following statement.
INPUT #1,A$;B$
To prevent this problem, the WRITE# statement should be used, instead of the
PRINT# statement. The example is shown below.
WRITE #1,A$,B$,12,-34.5
When the above statement is executed, the data is written to the file as shown below.
“CAMERA, AUTOMATIC”, “93604-1”, 12, -34.5
The PRINT# statement can control the file format with the USING option.
For example:
PRINT #1,USING ”####.##”;12.3;456;9876.5
When the above statement is executed, the following data is written to the file, and
the comma (,) placed at the end of the format is used for delimiting the data.
12.30, 456.00, 9876.50,