Random Files Question

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings to all.

Random Files Test Case (not compressed, not encrypted):

Created a User defined type record consisting of 1 integer field, 1 long field, 1 string field (30 characters), 1 string field (64 characters).

Wrote 0 to 5 records using RAF WriteObject for testing and the size of the files in the 6 instances were:

0 record 0 bytes (just init the file)
1 record 407 bytes
2 record 814 bytes
3 record 1221 bytes
4 record 1628 bytes
5 record 2035 bytes.

Questions:

1. Why is the record length 407 bytes?
2. How can I calculate the length of a record for a User defined type? This would be vital information to be able to randomly access any record on file since CurrentPosition is required.
3. Is there an app out there that will allow me to view or display the contents of a RAF file that contains mixed data types (int, long, string, date)?

As usual, thank you for your help.

Best regards.
 
Last edited:

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you Erel

Thamk you, Erel.

I was trying to leverage my knowledge of random files in the mainframe and PC worlds, but it seems that your advice on using SQLite is the right path to follow.

Best regards.

Sandy
 
Upvote 0
Top