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:
00456940
Views:
20
>I have a project that I am working on converting a QBasic or Quick Basic program to VFP. The data files that are used are saved as random data files, so the numeric data is unreadable to VFP. I have found out that the numeric data is saved in this format:
>
> I = integers - stored as 2 bytes
> S = Single Precision - stored as 4 bytes
> D = Double Presision - stored as 8 bytes
> L = Long Integers - stored as 4 bytes
>
>Need some help with functions or routines to convert these into something that is readable to VFP so that I can save them into tables, has anyone done this before?
>
>Thanks in advance.
Ron,

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.

Basically, what would have to be done is to find out the type declaration for each record. QBASIC could both read and write a single record using its file I/O mechanisms. Once you have the type declaration, you'd simply have to open a file for input and another (new file) for output, read one record in (I believe that the syntax was something like GET #filenum% < variable name >), convert it and output it using something like PUT #outfile$ < string name >. Unfortunately, I don't have access (and won't until after the first of the year) to some of the documentation that could help further.
George

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

Click here to load this message in the networking platform