$null

From Scriptwiki
Jump to: navigation, search

Returns absolutely nothing. Used to compare values in If-Then-Else checks.

$null
  • This identifier has no options or parameters.

Example

The first example shows the common use, if any, of $null.

if (%age == $null) { echo -a the variable does not exist }
elseif (%age != $null) { echo -a the variable does exist! }

The same thing can be done with simple checking, as shown below.

if (!%age) { echo -a the variable does not exist as it returns nothing when called }
else { echo -a it does not not exist, hence it must exist, woho. }