Having just got back into C I'm trying to write a simple app for the palm.
Basically it's a mileage calculator. Simple form with 2 edit fields and a
button.
Litres goes in the first field, miles goes in the second and the button
does this:
Convert Litres to gallons
Divide Miles by Gallons
set the text of a label to the Miles/Gallon.
So far everything works as far as the event processing goes.
One thing I can't quite get a hold of, is how to get the contents of the
edit fields and perform the arithmetic on them. They will be floats like
14.56 litres and 195.8 miles etc.
I can't find the equivalent of strToF in standard C to convert a string to a
float. Plus I'm a little unclear as to what I have to do to get the text out
of edit fields: I'm assuming it's something like:
Get Handle of Field.Text
Get Size of Field.Text
Get CharPointer to Field.Text
Allocate via MemHandleNew
Set a New CharPtr to New Memory
Copy the string from *Field.Text to *Newpointer
It's all a little confusing <G>
BAzz