6 - 4 6 - 4
MELSEC-Q
6 I/O Processing of Data Files
The following shows the data when performing read or write operation into the
sequential file.
When handling character data
Example
A$ = "ABC"
B$ = "123"
C$= "@@@"
• PRINT # n, A$ ; B$ ; C$
[CR] [LF]
@ @ @
3
2
1
C
B
A
Contents of data file
Don't forget to
enclose the
commas (,) with
double quotation
marks to be
written in the file.
Always use
CHR$(&H22) for
double quotation
marks. " " " cannot
be used.
In this case, ABC, 123, and @@@ have no separators, to the contents of the data file
will consider these to be one data.
In order to handle these as three separate data, commas (,) must be used as
separators.
• PRINT # n, A$ ; " , " ; B$ ; " , " ; C$
[CR] [LF]
@ @ @
3
2
1
C
B
A
,
,
Contents of data file
BASIC treats the commas as separators, so these are treated as three separate data.
Example
D$ = "@@@@, @@@@"
E$ = "@@@@@5-1-14"
@
• PRINT # n, D$ ; E$
@ @
@ @ @@ @@@ @ @ @
@@ @ 5 - 1 - 1 4 [CR] [LF]
@
In this case, the comma (,) in D$ will be treated as a separator, so the readout will be
treated as two separate data as shown below.
"@@@@"
"@@@@@@@@@5-1-14"
To separate the data as the same as the original data, double quotation marks (") will
be used as follows. Always use the CHR$ function when using double quotation
marks (").
• PRINT #n, CHR$(&H22) ; D$ ; CHR$(&H22) ; , " ; E$
@
@@ @ @ , @ @@@ @
@ @ @ @ @ 5 - 1 - 1 4 [CR] [LF]
@
"
"
BASIC will treat data surrounded in double quotation marks to be one data.
Therefore, it will be using the same separating method as D$ and E$.