|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Sat Oct 09, 2004 7:50 pm
#if Statement |
I was looking at the #if statement syntax and realized the false condition is considered optional. Does optional mean if there is no false condition in the #if statement, then #if won't default to the next statement for the false condition?
I've noticed in the past, if I didn't always put a false condition, Zmud would assume there would be a false condition by using the next line or something like that.
Syntax: #IF expression true-command [false-command] |
|
|
|
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Sat Oct 09, 2004 8:22 pm |
If there is no false-branch then that branch wont be run :-). When zero or one branch of the if-statement has been run the next statement in the script is run.
Example:
#if true {#echo true} {#echo false} // Run true-branch. Then continue to next statement.
#echo After if-statement
> true
> After if-statement
#if false {#echo true} // No false-branch. Continue to next statement.
#echo After if-statement
> After if-statement
#if true {#echo true} // Run true-branch. Then continue to next statement.
#echo After if-statement
> true
> After if-statement |
|
|
|
|
|