So just for clarity of if, else and elseif....
Lets say I have enetered a simple math equasion typed out in my program (see below)
var a:iunt = 5;
a = a + 5 * 2 + 20; //answer is 40
I then could add an if and else statement (see below)
if (a == 24) {
trace ( "The Answer is 24" );
}
else {
trace ("The Answer is not 24");
}
Where I get confused is the elseif statement. Btw is their a space between the word else and if? How do you write the elseif statement (what would the code look like if I wanted it to say "The answer is less than 50" and for that sentance to be true?
There is a space between the "else" and the "if".
if (a == 24)
trace("The answer is 24")
else if (a < 50)
trace("The answer is not 24 but is less than 50")
else if (a > 100)
trace("The answer is more than 100")
else
trace("The answer is not 24, is not less than 50, and is not more than 100")
Gordon Smith, Adobe
Thank you Gordon
My program is working correctly now. It was just the space I was missing lol