From WikiChip
Difference between revisions of "mirc/identifiers/$$"
(Created page with "{{mirc title|$$ Identifier}}'''$$''' is a construct which allows you to halt the script if the identifier returns $null. If used correctly it's a very short and simple way to...") |
Maroonbells (talk | contribs) m |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$$ Identifier}}'''$$''' is a construct which allows you to halt the script if the identifier returns $null. If used correctly it's a very short and simple way to halt a routine if a parameter is $null | + | {{mirc title|$$ Identifier}}'''$$''' is a construct which allows you to halt the script if the identifier returns $null. If used correctly it's a very short and simple way to halt a routine if a parameter is $null. |
− | |||
+ | '''Note''': $$ is not executing a /halt, it's effectively a way to halt completely the script execution, just like /halt, except that /halt also implies /haltdef, whereas $$ does not. This can be used inside events to /halt without /haltdef'ing. You can use the construct '$$null' for example. | ||
== Synopsis == | == Synopsis == | ||
<pre>$$identifier</pre> | <pre>$$identifier</pre> | ||
== Examples == | == Examples == | ||
− | <source lang="mIRC"> | + | Halts the echo unless the active window is a channel: |
− | + | <source lang="mIRC">//echo -a $$chan test</source> | |
− | |||
+ | * Note: $$ without any following non-spaces touching it behaves as if an identifier returning the literal $$ string, however it does not recognize $$$ as if halting the $$ identifier. $$3 halts the script if $3 is null. Only the final command here is an error: | ||
+ | <source lang="mIRC">//tokenize 32 parm1 parm2 parm3 | echo 3 -a $ $$ | echo 4 -a $$3 | echo 5 -a $$3a,b | echo 5 -a $$,b</source> | ||
== Compatibility == | == Compatibility == | ||
− | {{mIRC compatibility| | + | {{mIRC compatibility|2.8c}} |
== See Also == | == See Also == | ||
− | + | * {{mIRC|/halt}} | |
− | {{mIRC | + | * {{mIRC|/haltdef}} |
− | |||
− |
Latest revision as of 00:39, 24 December 2019
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$$ is a construct which allows you to halt the script if the identifier returns $null. If used correctly it's a very short and simple way to halt a routine if a parameter is $null.
Note: $$ is not executing a /halt, it's effectively a way to halt completely the script execution, just like /halt, except that /halt also implies /haltdef, whereas $$ does not. This can be used inside events to /halt without /haltdef'ing. You can use the construct '$$null' for example.
Contents
Synopsis[edit]
$$identifier
Examples[edit]
Halts the echo unless the active window is a channel:
//echo -a $$chan test
- Note: $$ without any following non-spaces touching it behaves as if an identifier returning the literal $$ string, however it does not recognize $$$ as if halting the $$ identifier. $$3 halts the script if $3 is null. Only the final command here is an error:
//tokenize 32 parm1 parm2 parm3 | echo 3 -a $ $$ | echo 4 -a $$3 | echo 5 -a $$3a,b | echo 5 -a $$,b
Compatibility[edit]
Added: mIRC v2.8c
Added on: 26 Mar 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.