Menu

Random access files

Raul Tomaz
2019-07-27
2019-07-31
  • Raul Tomaz

    Raul Tomaz - 2019-07-27

    Hi ,
    I have seen this paragraph in the GW-Basic manual :

    "Creating and accessing random access files
    requires more program steps than with sequen-
    tial files, but there are advantages to using ran-
    dom access files. One advantage is that random
    access files require less room on the disk,
    because GWBASIC stores them in a packed
    binary format. "

    Does anybody know where I can get more information about the format of this 'packed
    binary format'?

    Thank you,
    Raul

     
    • Marc 'BlackJack' Rintsch

      I think the paragraph is a little bit misleading because it's not GWBASIC that stores numeric values in packed binary format in random access files but the programmer does. The programmer could also choose to save numeric values as text in random access files.

      The conversion functions are CVI, CVS, CVD, MKI$, MKS$, and MKD$. One could argue ASC and CHR$ belong also in this category, for converting single bytes. Integers are stored as lilttle endian two's complement. The single and double precision floats use the „Microsoft Binary Format“ (MBF) as described in the PC-BASIC manual: http://robhagemans.github.io/pcbasic/doc/2.0/#mbf

       
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.