Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More info about Random Access files
#20
(02-24-2026, 12:49 PM)bplus Wrote: @SMcneill OK I didn't know you could do a Random Access without LEN in Open statement, was that in QB4.5?

It defaults to a LEN of 128.  Unless you specify the size, your records are going to be 128 bytes each.

The difference is in the variable type you use to write the data.   If you use a variable-length string, it writes the size first as a 2-byte integer.  Otherwise, since every other variable type is a set number of bytes, it just uses that size automatically and doesn't record those 2-bytes for you.

OPEN.... LEN = x

If you use variable length strings, they have to be a max of x - 2 bytes in length or you'll get errors.  Otherwise, any other data type has to be less than x bytes in length.   If LEN is not specified, then it defaults to 128.
Reply


Messages In This Thread
RE: More info about Random Access files - by Pete - 02-24-2026, 01:44 AM
RE: More info about Random Access files - by Pete - 02-24-2026, 05:13 AM
RE: More info about Random Access files - by SMcNeill - 02-24-2026, 03:45 PM
RE: More info about Random Access files - by Jack - 02-24-2026, 02:41 PM
RE: More info about Random Access files - by Pete - 02-24-2026, 05:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Embedding and Extracting MANY files ! ahenry3068 20 1,541 11-15-2025, 10:19 AM
Last Post: ahenry3068
  random maze map. math help pmackay 4 564 08-10-2025, 11:22 AM
Last Post: pmackay
  Random Number Generator pmackay 14 1,266 07-30-2025, 12:56 PM
Last Post: SMcNeill
  generating a random number in the full range of that number? (Integer, Long) madscijr 2 657 05-01-2025, 09:11 PM
Last Post: madscijr
  program that stitches together a bunch of image files into one giant poster? madscijr 15 2,340 10-24-2024, 06:08 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)