QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: badger on September 29, 2020, 02:56:55 pm
-
Hello
What is the limit of records a random file can have
Badger
-
I believe its limited by file size now, which is limited by how big your hard disk is.
unless there is a nuance with RANDOM access files I'm missing, as I stick with BINARY almost all the time.
-
Hello
Wow that is a far cry for the 35000 or so limit from qb4.5 thanks a lot
Badger
-
Hello
Wow that is a far cry for the 35000 or so limit from qb4.5 thanks a lot
Badger
35000 is close to limit of INTEGER 32,000+ which might have been a false limit due to number used for record number access.
-
Hello
that is correct i have used qb anything since the 90s around 32000 was correct. I am now using a long for record length i dont need that much but it is there. I will be using a long to count the records as well
Thanks
Badger
-
A quick demo showcases that there's not much of a limit to the number:
Warning, the above creates a 5GB file and will take a few moments to run the first time you compile and execute it, as it's allocating disk space and all for that massive text file, before writing those two data entries.
A LONG variable only allows us to access 2,147,483,647 elements before we overflow, and as you can plainly see, we're putting data to records beyond that. QB64's internals, for records, is probably limited by _INTEGER64 values -- meaning we can have a maximum of 9,223,372,036,854,775,807 records. If your drive can hold more than that, then you don't need to be coding in QB64! Instead, you need to send me a few million dollars, and I'll become your personal coding machine, forever more! :D
-
Why not just...
-
Why not just...
Simply because I was testing various limits (INTEGER, LONG, INT64, signed & unsigned), as I went, waiting to see if any tossed an error. The 2GB position, I apparently just fell asleep on and didn’t erase afterwards. :P
-
Hello
i may be asking a really stupid question here but the put #1, 2000000000, junk puts in 2000000000 records
Badger
-
Hello
i may be asking a really stupid question here but the put #1, 2000000000, junk puts in 2000000000 records
Badger
It only puts 1 record to file (the 2 billionth record), and with each record only being 1 byte each, that makes the datafile 2GB in size. The first 1,999,999,999 records are all nothing more than blank spaces, at this point.