Gear tooth sensor is a phased interrupt as I recall, making it digital. It pulses once per tooth, and you count these in an ISR.
as for your original question... I'm not sure what language you're trying to use.
In MPLAB/C18 C, syntax would be
Code:
if(condition1){
//code to run if condition1 is true
}else if(condition2){
//code to run if condition2 is true and condition1 is false
}else{
//code to run if both condition1 and condition2 are false.
}