Sub Process_Globals
Dim value1(1000) As Int
Dim value2(1000) As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'------------------READ-------------------------------------------
Dim raf As RandomAccessFile
raf.Initialize(File.DirInternal, "1.dat", False)
For i = 0 To 999
value1(i) = i
Next
For i = 0 To 999
raf.WriteInt(value1(i),raf.currentposition)
'Raf.currentposition=0 before the first int is written, then is automatically set
' at 2 for the 2nd int, 4 for the 3rd and so on (I'm assuming the int takes 2 bytes)
Next
raf.Close
'-----------------------------------------------------------------
'------------------WRITE-----------------------------------------------
Dim raf As RandomAccessFile
raf.Initialize(File.DirInternal, "1.dat", False)
Value2(0) = raf.readint(0) 'read the 1st int at the beginning of the file
For i = 1 To 999 '1 not zero. The first already written
value2(i) = raf.ReadInt(raf.currentposition)
Next
raf.Close
'------------------------------------------------------------------
For i = 0 To 999
Log(value2(i))
Next
End Sub