| Posted 09/07/12 at 10:12 PM||Reply with quote #1 |
str_GetW() is a great call .
A lot of the string processing on my ardunio moved to GFX.
However there is a strange bug/Behaviour
If str_GetW() encounters a 0 in the string it does not convert it and status returned is 0 (fail)
for e.g E06|00|16
works great till the first pipe (|) and returns 6 as expected , then for the next two chars it fails (returns 0) and value in the &var remains unchnaged
then after the second | it work correctly and returns 16
I assumed that if it encounters 0 it will conver all 0's to 0 move the pointer to the second pipe and return success ( 1)
or is the current behaviour the "provided" behaviour
| Posted 10/07/12 at 10:12 AM||Reply with quote #2 |
str_GetW is working as intended, here is an example that checks it.
var c, p, n;
p := str_Ptr(string);
if (str_GetW(&p, &n))
print("number ", n, "\n");
else if (str_GetC(&p, &c))
print("character ", [CHR] c, "\n");
| Posted 12/07/12 at 12:04 PM||Reply with quote #3 |
|got to try this one out, i must be blind if this is working correctly.|
Have a few other issues that require more attention (see other thread)
Thanks for the nifty peice of code below
| Posted 14/07/12 at 03:15 AM||Reply with quote #4 |
|My sample was incorrect,|
change it to
character 0 (it should have detected as number)
| Posted 15/07/12 at 09:32 PM||Reply with quote #5 |
|Hi, yes unfortunately you are correct, will not work for a single zero followed by a character that is > 0x21 (space).|
The only temporary workaround is to follow any single zero's with a space.
It will be fixed in the next PmmC release