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$.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...