Hi,
That time I had parked the project and now I'm here again to continue it:
What I need is to create (write and read) a simple text file with fixed lenght records (and fixed fields inside each record).
Also, when I connect the device with the PC, I have to copy the file in Windows and simply read it with notepad and also with another windows VB.NET application that manage this file, knowing that it has fixed lenght records and fixed fields.
This application is an Android migration of another VB.NEt application and I must keep the same identical file format of my VB.NET application.
I think SQlite, thought more efficient, would bring me on the wrong way.
RAF should be the correct method, but I have difficulties to find how to do.
This is my simple test project:
Dim raf As RandomAccessFile
Dim noa As Int
Dim buflen As Int
Dim pos As Long
Dim miobuffer As String
buflen=6
raf.Initialize(File.DirRootExternal, "prova.txt", False)
noa=raf.Size/buflen
Log("record " & noa)
For x=0 To 4
pos=x*buflen
miobuffer="ciao" & Chr(13) & Chr(10)
raf.WriteObject(miobuffer, False, pos)
Next
raf.Close
What I want to obtain is a simple prova.txt text file that I can open with Notepad and see:
ciao
ciao
ciao
ciao
ciao
But the result is much different, with a lot of extra characters.
Anybody can help me ?
MArco