From WikiChip
Difference between revisions of "mirc/identifiers/$null"
(Created page with "{{mirc title|$null Identifier}}'''$null''' This identifier does not return a value, just like {{mIRC|$true}} or {{mIRC|$timeout}}, it's a value you can use in comparison in {{...") |
m (→Compatibility: This was added in 4.5) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$null | + | {{mirc title|$null identifier}}'''$null''' does not return a value; just like {{mIRC|$true}} or {{mIRC|$timeout}}, it's a value you can use in comparison in {{mIRC|/if}} or {{mIRC|/while}}. An empty variable also returns '''$null'''. |
+ | |||
== Synopsis == | == Synopsis == | ||
<pre>$null</pre> | <pre>$null</pre> | ||
− | == | + | == Parameters == |
− | |||
None | None | ||
== Properties == | == Properties == | ||
− | |||
None | None | ||
== Example == | == Example == | ||
+ | |||
+ | If you created an empty variable without assigning a value, then you can check its existence and emptiness like this: | ||
+ | <source lang="mIRC"> | ||
+ | set %somevar | ||
+ | if ($var(%somevar)) echo -a This variable exists. | ||
+ | if (%somevar == $null) echo -a This variable is empty and has no value. | ||
+ | </source> | ||
+ | |||
+ | |||
<source lang="mIRC">//if ($? != $null) echo -a you entered $v1</source> | <source lang="mIRC">//if ($? != $null) echo -a you entered $v1</source> | ||
== Compatibility == | == Compatibility == | ||
− | {{mIRC compatibility| | + | {{mIRC compatibility|4.5}} |
− | == See | + | == See also == |
− | {{mIRC|$false}} | + | * {{mIRC|$false}} |
− | {{mIRC|$true}} | + | * {{mIRC|$true}} |
− | [[Category: | + | * {{mIRC|$var}} |
+ | * {{mirc|identifiers|List of identifiers}} | ||
+ | {{mIRC identifier list}} | ||
+ | [[Category:mIRC identifiers|null]] |
Latest revision as of 17:14, 21 February 2024
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$null does not return a value; just like $true or $timeout, it's a value you can use in comparison in /if or /while. An empty variable also returns $null.
Synopsis[edit]
$null
Parameters[edit]
None
Properties[edit]
None
Example[edit]
If you created an empty variable without assigning a value, then you can check its existence and emptiness like this:
set %somevar if ($var(%somevar)) echo -a This variable exists. if (%somevar == $null) echo -a This variable is empty and has no value.
//if ($? != $null) echo -a you entered $v1
Compatibility[edit]
Added: mIRC v4.5
Added on: 30 Jun 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
mIRC identifier list