Bug? Bug in RandomAccessFile ?

D

Deleted member 103

Guest
Hi,

This code works in B4a without problems.
B4X:
        Starter.raf.Initialize(File.DirDocuments, "file.txt", False)
        Dim lst As List = Starter.raf.ReadB4XObject(Starter.raf.CurrentPosition)
        Starter.raf.Close

In B4i I have to rebuild "raf" the object every time, otherwise it crashes.
B4X:
        Dim raf As RandomAccessFile
        raf.Initialize(File.DirDocuments, "file.txt", False)
        Dim lst As List = raf.ReadB4XObject(raf.CurrentPosition)
        raf.Close
 
D

Deleted member 103

Guest
It is more correct to dim a variable before you initialize it again. There is no reason to use a global variable in this case.
So I have no problem, I've only wondered because in B4a, without re-dimensioning the variable, it does not make any problems.
Question, after "raf.Initialize" the current position "raf.CurrentPosition" should not be zero?
 
Top