Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
QBasic Random Data Files
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00456801
Message ID:
00456956
Views:
25
>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!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform