Hi berklee.
I am not sure that I understand what you are asking, so this may be a pointless post.
To write and read info from file into a structure you would use:
Code: Select all
WriteData( @Struct, SizeOf(struct) )
; later ...
ReadData( @struct, SizeOf(struct) )
Note: If you are writing/reading structures with string elements, this is a problem as the structure contains a pointer to the string and therefore when later read in it will probably be an invalid pointer or memory address.
If you are writing and later reading XML or any markup-type text, you can just use strings to write/read.
Code: Select all
WriteStringN( strVar )
; later ...
ReadString( strVar )
And handle your own tag management (openers/closers)
If you are creating your own record definitions and access, you also create your own rules, so reading and writing are done your way.
If your requirements are simple, eg your records are fixed length and files are small and not updated just written from scratch, this fairly straightforward. Otherwise it gets complex with variable length records and free-space management, etc.
With this you would have, say, a vli in the first word or long of each record, defining the size of the record, perhaps followed by a type indicator to define what fields followed, and perhaps even vli for each field (eg string). You would need to read each of these, and each would determine action taken for rest of record.
If you are doing sequential access, ok, if not you have to create your own ISAM or DB, something I personally feel is non-trivial - you might be better off using a DB like mySQL.
If the above is useless to you, sorry, but at least my post-count went up.

@}--`--,-- A rose by any other name ..