if statement

can the if statement have more then one command? example test for a button push and say not pushed turn on one output but if pushed turn on three(3) outputs

if example only from exampes

if (analogValue > threshold) { digitalWrite(ledPin, HIGH);

} else { digitalWrite(ledPin,LOW); digitalWrite(ledPin1,LOW); digitalWrite(ledPin2,Low); }

can the if statement have more then one command?

Both the if true and else parts can have blocks, by using curly braces around the blocks.

if(analogValue > threshold)
{
   // Do several things here
}
else
{
   // Do several things here
}

Thanks for the reply that answers my question must of had an error in my code then.

Dan