Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
QBasic Random Data Files
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00456801
Message ID:
00456956
Vues:
26
>Being an old QuickBASIC programmer I can tell you that integers weren't stored as 2 bytes, but one. Long integers were two bytes. I would think that this might apply to QBASIC as well.

I'm sorry George. Your memory is failing. Integers of just one byte would have being too short for most practical purposes (+/-127).

Short integers are 2 bytes (+/- 35.535), while single and double precision, as I recalled were stored as a combination of exponent/mantissa with a floating point.

The explanation of the later would be quite long, so I've found an article for Ronald that can take him close to the solution.

To convert the integers, you have to multiply each byte sequentially by: 1, 256, 65536, and 16777216 (for longs, just 1 and 256 for shorts). If the integers are signed, you have to read the first bit of the most significative byte to know if it's positive (0) or negative (1). Of course, you don't have to count that bit.

Read the help on BitSet and BitTest for the bit handling operations.

Hope this helps. If you can't understand it, just ask me and I'll try to be more clear, or, if you can wait a little, maybe write some conversion functions (I have to get a Basic first, as I don't have it anymore at home, neither).

Good luck!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform