You can place a float into a record the same way you do any variable.
Assign the voidpointer to the address of the float and write sizeof(float)
number of bytes to the record. To read it, do the opposite. Read in
sizeof(float) number of bytes and either shift the bytes into your float or
assign the pointer to your float variable. I believe I found examples at
roadcoders, but it has been a little while since I did this last.
If your record has a mixed bag of variables you can use this method.
Create a structure that has all the variables you use (assuming you used
fixed size strings)
Populate the structure variables with your data.
assign the voidpointer to the address of your structure
write it to the DB
To read a structure from the db
create a pointer to the structure
read in the record
assign the returned pointer to the structure pointer
and magically the structure will be populated with the record's data
So far I've only been able to display a float in a field if you first
convert the float to a string. If you want to format it, you will need to
roll your own functions.
Hope it helps
Dave
-----Original Message-----
From: Mike Davis <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, March 18, 1999 10:15 PM
Subject: Parsing Floats and Ints from Records Question
1) What is a good method for parsing floats and ints from
a DB record that has both strings, ints and floats?
2) How does one display floats and ints in Form Fields?
Most examples only show single-field text records and displaying
of text data to Form Fields.
--
-----------------------------------------------------------------
Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------