Variable SD Card names in FemtoBasic?
Duane C. Johnson
Posts: 955
Hi Mike;
I want to be able to read many thousands of data files on an SD Card using FemtoBasic.
The file names are basically numbers.
However, the command description requires names to be a "string constant". Or am I wrong?
This doesn't work for me. Yes, I can work with a single huge file that contains all the data.
But it takes to much time to access an element in the file. The whole data set may contain as much as 1G bytes or so. This data set is to contain solar position data for 30 years or so. Well actually the stepper motor values for the 30 years.
It would work so much better to have many files each representing an element that is quickly found, opened, and read.
Is there a way to use something other than a string constant?
Or a way to change or fudge a string "constant"?
Thanks
Duane
I want to be able to read many thousands of data files on an SD Card using FemtoBasic.
The file names are basically numbers.
However, the command description requires names to be a "string constant". Or am I wrong?
This doesn't work for me. Yes, I can work with a single huge file that contains all the data.
But it takes to much time to access an element in the file. The whole data set may contain as much as 1G bytes or so. This data set is to contain solar position data for 30 years or so. Well actually the stepper motor values for the 30 years.
It would work so much better to have many files each representing an element that is quickly found, opened, and read.
Is there a way to use something other than a string constant?
Or a way to change or fudge a string "constant"?
Thanks
Duane
Comments
It would be possible to modify Rokicki's driver to allow random read file positioning and add a statement to support it, but it would take a bit of work. It would also be possible to allow an optional numeric suffix for a file name in the OPEN statement. I've mentioned before that I don't intend to add any more features to FemtoBasic. It's already a large program. You're welcome though to add features to make your own version. I'd be happy to make suggestions and offer advice.
You can use a hash for text type searches but the hash index has to be unique. Julian date could be the index too.
The current release of my driver has supported seeking (random read file positioning) for some time.
-tom