Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing data stored in native 'c' format
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00099006
Message ID:
00099040
Views:
19
>>I have a need to import data generated from a machine controled by a C++ application. This application creates a data file in the format of:
>> 
>>typedef struct {
>>    char name[10];
>>    UInt8 tests;
>>    Uint32 Sample;
>>    time_t timeoftest;
>>    float value;
>>    } T_Series
>> 
>>My FoxPro application is curently in FoxPro 2.6a, but I also have FoxPro 3.0a & 5.0. Any help would be appreciated.
>> 
>> 
>>Thanks,
>> 
>>Michael W. Privott
>>TechWare Incorporated 
>>privott@techwareinc.com
>
>Michael,
>
>If you create a table whose layout matches the structure above (including each element of the time_t structure), you can read the data using append IF there is a newline character at the end of each record. Otherwise you can use fopen/fgets (almost identical to the c versions) to read each item and append blank/replace to populate the table. You will need to do some conversion work on the time_t and uint values to convert to strings (FoxPro will need '42' instead of integer 42 to read in a numeric field - this is simple enough).


Also, be careful when converting float, you will have to do it step by
step (I mean, bit by bit).
*****************************************************
Ing. Omar Zavala Moreno
Grupo Monteblaco "Donde nacen los champiñones"

omar@ozavala.com
Don't just try, do it!
Previous
Reply
Map
View

Click here to load this message in the networking platform