The "If" function is used by the code to generate an "if->then" logical couplet. Actually, as far as I know, it generates an "iff->then" couplet (If and only if this happens, then this.)
I think I understand what you're trying to ask for...
if(Some Condition A){
then if(Some Condition B){
then (Action C occurs);
}
}
While that seems logical from a standpoint, the "then" aspect is implied by the "if" code. Inputting an additional "then" is unnecessary and would probably break the code. To make the same conditions for which your event to occur, drop the "thens":
if(Some Condition A){
if(Some Condition B){
Action C occurs;
}
}
That would generate the following logical chain:
If Condition A is true, then if Condition B is true, then perform action C.Do you see how the "then" is implied by the code brackets?
Now, let's go a little more indepth with the coding.
if(!Some Condition A){
if(Some Condition B){
Action C occurs;
}
else{
Action D occurs;
}
}
else if(!Some Condition B){
Action E occurs;
}
This code first checks if Condition A is false. If it is not, all material between that check and the "else" function on the same tab line are ignored. Basically, it is telling the program this:
If Condition A is false, continue checking... otherwise...
The code continues to form a logical tree, which spells out:
If Condition A is false, then check condition B. If Condition B is true, perform Action C.
Otherwise, if Condition B is false, perform Action E. Otherwise, do nothing.
So the "then" is implied, and "else" serves as an "otherwise" condition in the code. Else lines are placed on the same column as the if statement they counteract.
Let's take one more step into the logic setup before calling it quits. I'm going to explain "And" and "Or" conditions.
if((!Some Condition A) && (!Some Condition B)){
Action C occurs;
}
else if((!Some Condition A) || (!Some Condition B)){
Action E occurs;
}
else if(Some Condition A){
Action F occurs;
}
else{
Action G occurs;
}
The above first checks if BOTH Condition A AND Condition B are false. If that is true, then the script performs Action C and concludes (The remaining clauses are all "else" clauses, so there are no more conditions to check.)
Should that first "if" clause fail, the script goes on to check if EITHER Condition is false. If it turns out that one is false, the script performs Action E and concludes.
If the second "if" clause fails, it is proven that at least one of the two conditions are true. The script goes on to test if Condition A is true. Like before, if the "if" condition is met, then the action is performed and the script concludes.
Finally, since there are no more possible combinations (They have been eliminated with the above if-statements), the script takes any remaining variables and performs the final action, G. It is important to be cautious with a straight "else" clause, otherwise other parameters might generate your action that you had not intended.
So to summarize the above script as a logic sentence:
If Condition A and Condition B are false, then perform action C. Otherwise, if Condition A or Condition B are false, then perform action E. Otherwise, if Condition A is true, then perform action F. Otherwise, perform action G.