I'm trying to use the string.toNumberWithBase() function and I'm getting an interesting bug (?)
This is on a Garmin 630.
Easy to reproduce with a minimal program. Create the basic App (the one with the monkey on the face)
edit the View.mc file's onUpdate to look like this
// Update the view
function onUpdate(dc) {
// Call the parent onUpdate function to redraw the layout
var fff,ggg;
fff = "0X";
ggg = fff.toNumberWithBase(36);
View.onUpdate(dc);
}
Run it in the simulator. It works without crashing.
Run it on an actual Garmin 630 and it crashes the app.
I have tried cycling through a number of string sequences, and the only 2 character one I have found so far is 0X (Thats zero X). All before it work, and all after it work, but 0X crashes it and only on the actual watch.
I'm suspecting it's trying to interpret the string as a hex number (eg 0X1A) and cant find the rest of the string given I only supply 2 characters.
Can anyone see if I'm mistaken in my use of the toNumberWithBase.
From my understanding, with 36, it should use 0-9 and A-Z