`prev Menu next`

STREAM File
An internal record type file can be made of a STREAM file.
A stream file is a sequence of values, rather than records.
To manipulate stream files, USE the following form of OPEN statements.
`OPEN #Channel_Number NAME File_Name ,RECTYPE INTERNAL ,ORGANIZATION STREAM
OPEN #Channel_Number NAME File_Name ,ACCESS OUTIN ,RECTYPE INTERNAL ,ORGANIZATION STREAM
OPEN #Channel_Number NAME File_Name ,ACCESS INPUT ,RECTYPE INTERNAL ,ORGANIZATION STREAM
OPEN #Channel_Number NAME File_Name ,ACCESS OUTPUT ,RECTYPE INTERNAL ,ORGANIZATION STREAM
`
Note.
On this BASIC, the separator of values is the characters CR(CHR$(13)) and LF(CHR$(10)).
That is, one value is recorded in one line. Numeric values are recorded in figures, Strings are quoted.
Example.

    100 DIM a(4),b$(3)
    110 DATA 1,2,3,4,a,b,c
    120 MAT READ a
    130 MAT READ b$
    140 OPEN #1: NAME "a:stream.txt", RECTYPE INTERNAL, ORGANIZATION STREAM
    150 ERASE #1
    160 MAT WRITE #1:a
    170 MAT WRITE #1:b$
    180 CLOSE #1
    190 END

The above program makes "a:stream.txt"
1
2
3
4
"a"
"b"
"c"