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:
00457022
Views:
23
>>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).

Don't forget that this was QBasic, and it (being a 16 bit product) couldn't handle anything greater (in terms of integers) greater than that. At least in QB (QuickBASIC) they were one byte and two (not signed, BTW).

>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.

Don't think I need to. A couple of years back I wrote an article about the bit manipulation functions for FoxPro Advisor.:-)

>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!


Martin, if it (the conversion program) was written in Quick or QBasic, there's no need to fool around with the various conversion routines. All you'd have to do is a PRINT #filenum to a file to do the conversion. The output would then be in the desired format. It isn't a terribly difficult problem in that environment. If I had the file structure, I could probably write it in less than an hour.

Now converting it directly in VFP might be more difficult with the single and double precision floating points, dates, etc.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform