Reputation: 13
Ok, so in the following actionscript 3.0 code there is a syntax error on line 2, but i don't know what that is. I'm a beginner so could someone please help me on this?
var numberToCast:Number;
on the following line there is a syntax error, says the compiler, and i haven't a clue what that is
for (numberToCast = –1; numberToCast<2; numberToCast++){
trace("Boolean(" + numberToCast +") is " + Boolean(numberToCast));
}
Upvotes: 1
Views: 603
Reputation: 14406
The problem is with your -
(numberToCast = –1;), it's not actually the minus symbol. Probably a symptom of copying and pasting (out of Microsoft Office maybe? Word is bad for replacing the minus with a dash)
And as per my comment, you will need to define (var
) numberToCast
(either prior to the loop or in the loop declaration) or you'll get a different error after fixing the minus.
Upvotes: 1