for (var i = 0;i<12; ++i ){
if(i = 0;i<position; ++i) {
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
}
Hi
can anyone advise me how to write this constant correctly?
Thank you
for (var i = 0;i<12; ++i ){
if(i = 0;i<position; ++i) {
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
}
Hi
can anyone advise me how to write this constant correctly?
Thank you
What are you trying to accomplish with this code? Do you have more context?
Also, I'm curious, how are you posting?
You may have noticed that your posts look different than everyone else's: they have a fixed width font that doesn't wrap long lines and there's a grey background. I've seen this more than once, but I'm not sure why it's happening.
What browser and platform? Desktop or mobile? Are you pasting your text from elsewhere?
Hi, I'm sorry, I'm using Linux, so it's possible that the font encoding in the browser is different.
No worries, I was curious about that, as I've seen it before. Just another fun quirk of the Garmin forums -_-.
That isn't valid code. An if statement is supposed to contain a single condition inside the parens "( )", but your if statement looks like it's supposed to be a for loop (it's got three expressions, the first of which looks like the initial value, the 2nd looks like the termination condition, and the third looks like the loop expression.)
I'm still not sure what the code is intended to do?
You want to set the color to RED up to 12 times? If position is 6, is it supposed to run 6 times? I could tell you what code to write, but I'm not sure what it's supposed to do.
Is this what you're looking for?
for (var i = 0; i < 12; ++i) { if (i < position) dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT); } // there *has* to be more context here... }