Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indexed files
#13
(11-04-2023, 07:44 AM)PhilOfPerth Wrote: Thanks to those who tried to help me, but...  Huh
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! Smile
b = b + ...
Reply


Messages In This Thread
Indexed files - by PhilOfPerth - 11-03-2023, 11:21 PM
RE: Indexed files - by a740g - 11-03-2023, 11:40 PM
RE: Indexed files - by bplus - 11-03-2023, 11:44 PM
RE: Indexed files - by bplus - 11-03-2023, 11:50 PM
RE: Indexed files - by TerryRitchie - 11-03-2023, 11:55 PM
RE: Indexed files - by bplus - 11-03-2023, 11:55 PM
RE: Indexed files - by SMcNeill - 11-04-2023, 12:29 AM
RE: Indexed files - by bplus - 11-03-2023, 11:57 PM
RE: Indexed files - by JamesAlexander - 11-04-2023, 01:20 AM
RE: Indexed files - by PhilOfPerth - 11-04-2023, 01:39 AM
RE: Indexed files - by mnrvovrfc - 11-04-2023, 02:21 AM
RE: Indexed files - by PhilOfPerth - 11-04-2023, 07:44 AM
RE: Indexed files - by bplus - 11-04-2023, 11:54 AM
RE: Indexed files - by SMcNeill - 11-04-2023, 12:42 PM
RE: Indexed files - by Dimster - 11-04-2023, 01:57 PM
RE: Indexed files - by bplus - 11-04-2023, 04:50 PM
RE: Indexed files - by Kernelpanic - 11-04-2023, 11:13 PM
RE: Indexed files - by PhilOfPerth - 11-05-2023, 12:21 AM
RE: Indexed files - by bplus - 11-05-2023, 01:55 PM
RE: Indexed files - by PhilOfPerth - 11-05-2023, 11:31 PM



Users browsing this thread: 1 Guest(s)