Why are you just guessing what to do? You're better than that. The construct is:
if ( condition )
{
// the body of the if clause goes here
}
else
{
// the body of the else clause...
Type: Posts; User: GregBrannon
Why are you just guessing what to do? You're better than that. The construct is:
if ( condition )
{
// the body of the if clause goes here
}
else
{
// the body of the else clause...
That construct is certainly giving you errors. if and else are separate clauses. A proper else statement is not included inside the if clause.
KW's answer still applies, but in a more general sense: Enclose ALL clauses inside curly brackets, "{}".