(11-04-2023, 07:44 AM)PhilOfPerth Wrote: Thanks to those who tried to help me, but...
I guess I'm too old or too dense, or both, to make sense of any of the examples.
I can't get my head around the Type structures etc.
So I guess I'll go back to my (very primitive) original plan (crawls back into cave and pulls bush across doorway).
The responses were very much appreciated.
You know I was thinking after my posts there is a really easy way to do this:
Just load the file into an array and then you have an indexed access!
When done processing whatever with array just load it back into a newly rewritten file.
Then you have indexed access without any fixing up of your file as long as 1 file line is 1 record.
The array will have to be dynamic which means you can change the size of the array ie for adding new records = lines
So don't say DIM MyArray say REDIM MyArray that sets up an array to be dynamic.
THEN you can use REDIM _PRESERVE to make the array bigger to add more records.
Just keep track total Records or lines = UBOUND of array.
Also use base 1 array so REDIM MyArray(1 to MaxRecords) so the Ubound of array IS the number of records you have, no fiddling with +-1 like with 0 based arrays.
Piece of Cake man!
b = b + ...