It's like != $null && != 0. But that's nit-picking in your concrete case, as you'll hardly add "0" as a badword to the file. smile

In other situations, especially if numerical values are involved, the difference between if (something) and if (something != $null) can be both a pitfall and useful for scripts. Take for example some "boolean switch" (0=false 1=true) in an .ini or the like.

You can see the difference at %y in this example:
Code:
alias test {
 var %x = 1, %y = 0, %z
 if (%x != $null) echo -a x has some value
 if (%y != $null) echo -a y has some value
 if (%z != $null) echo -a z has some value
 if (%x) echo -a x has a value that isn't 0
 if (%y) echo -a y has a value that isn't 0
 if (%z) echo -a z has a value that isn't 0
}

qwerty beat me to it

Last edited by Horstl; 07/05/09 12:31 AM.