And how can i set it back to a char sequence to then apply it back to a
different text field?
The reason I want to do this is to do some math on the number, then
spit it back out in a different text field.
thanks,
David
--
---------------------------------------------------------------------
DataGetŽ & PocketLogŽ www.dataget.com
Data Collectors www.baxcode.com
--------------------------------------------------------------------
"David" <williams...@gmail.com> wrote in message
news:1161114656.6...@i3g2000cwc.googlegroups.com...
> I created a NUMERIC MAXCHARS 40 UNDERLINED text field for the GUI.
> And I figured out how to get the text inside that text field inside the
> Palm C Code.
> I seem to only be able to extract it as a char sequence even though it
> is NUMERIC.
Hi David,
The NUMERIC parameter means that the text field will accept only the
characters '0' to '9' and the thousands and decimal separator. (Do you
have a copy of the Palm OS Programmer's API Reference?) The OS doesn't do
any string->number conversion for you.
> How can i convert my char sequence into float?
> static Char bar[80];
You'll have to construct the number yourself by parsing the string. Not
quite as trivial as having the OS do it magically for you, but still
trivial nonetheless.
Good luck,
Ciaran
--
Ciaran Keating
Amadán Technologies Pty Ltd
Not trying to be funny or rude or anything, but... if you can do anything
at all in C then you can write this function.
Or maybe you're programming in some other language? In which case, if you
can figure out how to link a C function with an app written in another
language, then you can figure out how to write this function.
In fact, if you can figure out how to install the development tools for
the Palm and get them working, then you've got more than what it takes to
write this function :-)
Go on - give it a try!
Then use sprintf() to turn the floating point result back to a string.
There are a number of ways to go:
- use something like Codewarrior's MSL library
- use the Palm FloatManager (FlpFloat) functions
- write your own routines
or do like a lot of Palm programmers do and use integer math - and fake the
decimal point.
--
---------------------------------------------------------------------
DataGet® & PocketLog® www.dataget.com
Data Collectors www.baxcode.com
--------------------------------------------------------------------
"Tim Oltrogge" <trolt...@verizon.net> wrote in message
news:vURZg.10068$cH6.5572@trnddc07...
I've only scratched the surface of programming for the Palm. I downloaded
the cygwin tools and compile my programs using the gcc compiler and its
libraries. I'm using atoi() that way and I *assume* atof() is also available
even though it's not mentioned in the Palm reference manual.
StrAToI() is native to Palm. If you include the Float Manager, there is a
FplAtoF() for FloatTypes - but it is not supported by the PACE 5.0 feature
set.
In any case, floating point on the Palm leaves much to be desired and most
Palm programmers use integer math - simply store the decimal pt as a UInt8
(or uint8_t).
--
---------------------------------------------------------------------
DataGetŽ & PocketLogŽ www.dataget.com
Data Collectors www.baxcode.com
--------------------------------------------------------------------
"Tim Oltrogge" <trolt...@verizon.net> wrote in message
news:Vx4_g.2$rx.1@trnddc04...