HP Forums
AFilesB write index limit - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: AFilesB write index limit (/thread-17411.html)

AFilesB write index limit - Jacob Wall - 08-31-2021 03:33 AM

I haven't seen this documented anywhere, regarding the AFilesB command

For example, you can do this:
AFilesB("MyFile.txt"):={65,66,67} which creates the file MyFile.txt with the string "ABC" inside (no quotes)
Then you can do AFilesB("MyFile.txt",3):={68,69,70} to append "DEF" at index 3, and so on.

This is handy of course to build a file from a program. I hadn't noticed before today but it seems like the index maxes out somewhere around 524288, providing an index higher than the maximum results in an error.

This means the largest size of file that can be created is 512KB. You may think that is a reasonable limitation for a calculator, but of course the virtual calculator is capable of creating much larger files, as is the G2.

I am wondering if anyone can confirm this is an arbitrary limitation and whether there is any other solution besides splitting content across multiple files if it is necessary.