ASCII to Decimal converter
does anyone have a simple ascii to decimal converter, i really dont want to have to spend the time to write one since i dont have much time to work with the prop. i know it wouldnt be hard, but i thought id ask.

Comments
[noparse][[/noparse] Edit ] : After futzing around with my own code I found a C function on the Internet that was more elegant and translated it to Spin.
pub atol(pntr) | value, pos, c '' Converts string at pointer to signed long value := 0 ' clear result if (byte[noparse][[/noparse]pntr] == "-") ' if 1st char "-" pos := false ' mark pntr++ ' advance pointer else pos := true repeat while ((c := byte[noparse][[/noparse]pntr++]) > 0) ' get a character if (c => "0") and (c =< "9") ' valid? value := (value * 10) + (c - "0") ' yes, add to result else quit ' no, abort loop if pos return value else return -valuePost Edited (JonnyMac) : 7/22/2009 2:34:23 PM GMT
debug("G") will pass the decimal value of G, which is 71 to the debug method.
Rich H