1110
strtod
(continued)
See Also:
strtol
Example:
void StrToList ( const char *str )
/* Create list of floats on estack from the string of floats */
{
Access_AMS_Global_Variables;
BCD16 num;
unsigned char * start_ptr, * end_ptr;
EStackIndex old_top, k;
end_ptr = (unsigned char *)str;
old_top = top_estack;
push_quantum (END_TAG);
while( *end_ptr )
{
/* stop when end of string or fail */
start_ptr = end_ptr;
num = strtod((const char *)start_ptr, (char **)&end_ptr);
if( start_ptr == end_ptr )
break;
push_Float( num );
}
k = top_estack;
push_reversed_tail (k);
delete_between (old_top, k);
push_quantum (LIST_TAG);
return;
}
TI-89 / TI-92 Plus Developer Guide
Appendix A: System Routines — Utilities
/* pt to next value to convert */
/* conversion failed */
/* point to last val */
/* reverse the order */
/* delete the old copy */
/* make it a list */
Not for Distribution
Beta Version January 26, 2001