Rem ************** Save array to file
Dim RECORDS(40)
Rem Create Data
RECORDS(0)= 9999
RECORDS(34)= 1234
RECORDS(35)= 1111
Rem Write new records file
Save Array "records.wri",RECORDS(1)
If File Exist("records.wri")
If File Size("records.wri") = 164
Load Array "records.wri",RECORDS(1)
Endif
Endif
Rem ************** Read memblocks from file
If File Exist("testdata")
If File Size("testdata") = 7674
Open To Read 11,"testdata"
Read Memblock 11,5
Read Memblock 11,6
Close File 11
Endif
Endif
Rem ************** Save different datatypes in same file
Open To Write 2,"collection"
Rem Collection has 2 parts: NUMSTA word, string records
Write Word 2,NUMSTA
For IND= 0 To NUMSTA-1
Write String 2,STASH$(IND)
Next IND
Close File 2
Rem ************** File read section
If File Exist("collection")
Open To Read 2,"collection"
Rem Collection has 2 parts: NUMENT word, string records
Read Word 2,NUMSTA
For IND= 0 To NUMSTA-1
Read String 2,STASH$(IND)
Next IND
Close File 2
Endif
I'm unique, just like everybody else.