dougp:
And I've been wondering what the difference(s) might be between a string of if()s and a switch/case. Thanks!
The way I understand it is that in a switch/case, the switch only has to read the variable. In an if statement, there has to be some sort of comparison. Switch/case statements should be used when there are a lot of options....it makes it more efficient and easier to write than a ton of if statements.
AWOL:
This constructif ((curMillis - prevMillis) == 1000)is risky.
Much safer isif ((curMillis - prevMillis) >= 1000)
Oops, I missed that one! After I originally wrote it with '==' I thought "what if it gets hung up at some point and skips over that time??" Thanks, I will update it...
AWOL:
Please don't confuse strings with Strings.
...sorry, I meant 'String'.