From WikiChip
Difference between revisions of "mirc/commands/unset"
< mirc‎ | commands

m (Bot: Fixing links)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''/unset command''' removes any variables by their specified names. If a wildcard pattern was specified, all variables matching that pattern will be removed. The /unset command can be used to remove both local and global variables, however it can only remove one of them per name. Local variables take precedence over a global variable with the same name.
+
{{mirc title|/unset Command}}
 +
The '''/unset command''' removes any variables by their specified names. If a {{mirc|wildcard}} pattern was specified, all variables matching that pattern will be removed. The /unset command can be used to remove both local and global variables, however it can only remove one of them per name. Local variables take precedence over a global variable with the same name.
  
 
'''Note''': /unset has an evaluation issue with dynamic variables, you can read more [[Variables - mIRC#Special_behaviors_&_quirks|here]]
 
'''Note''': /unset has an evaluation issue with dynamic variables, you can read more [[Variables - mIRC#Special_behaviors_&_quirks|here]]
  
 
== Synopsis ==
 
== Synopsis ==
  /unset [-s] <%var> [%var2 [%var3...]]
+
  /unset [-slg] <%var> [%var2 [%var3...]]
  
 
== Switches ==
 
== Switches ==
* '''-s''' - Display an output showing the variables that are unset
+
* '''-s''' - Display an output showing the variables that are unset*
 +
* '''-g''' - Make sure the global variable is unset if you have both a global and local variable of the same name
 +
* '''-l''' - Make sure the local variable is unset if you have both a global and local variable of the same name
  
 
== Parameters ==
 
== Parameters ==
Line 68: Line 71:
 
-
 
-
 
* Unset %bar.4</pre>
 
* Unset %bar.4</pre>
 +
if multiple cleaning
 +
<syntaxhighlight lang="mIRC">
 +
/unset %semple,%foo,%cocorico,%mirc,%ms
 +
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="mIRC">
 +
alias unset {
 +
  tokenize 44 $1-
 +
  !.unset $*
 +
}
 +
</syntaxhighlight>
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v4.0
+
{{mIRC compatibility|4.0}}
 
 
Added On: 20/03/96
 
 
 
 
 
  
<small>Note: Individual switches were not taken into consideration.</small>
 
  
 
== See also ==
 
== See also ==
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of identifiers - mIRC|List of identifiers]]
 
* [[List of identifiers - mIRC|List of identifiers]]
* [[$var identifier - mIRC|$var]]
+
* {{mIRC|$var}}
 
* {{mIRC|/dec}}
 
* {{mIRC|/dec}}
 
* {{mIRC|/inc}}
 
* {{mIRC|/inc}}
Line 89: Line 98:
 
{{mIRC command list}}
 
{{mIRC command list}}
  
[[Category:MIRC commands]]
+
[[Category:mIRC commands|unset command - mIRC]]

Latest revision as of 14:14, 20 October 2018

The /unset command removes any variables by their specified names. If a wildcard pattern was specified, all variables matching that pattern will be removed. The /unset command can be used to remove both local and global variables, however it can only remove one of them per name. Local variables take precedence over a global variable with the same name.

Note: /unset has an evaluation issue with dynamic variables, you can read more here

Synopsis[edit]

/unset [-slg] <%var> [%var2 [%var3...]]

Switches[edit]

  • -s - Display an output showing the variables that are unset*
  • -g - Make sure the global variable is unset if you have both a global and local variable of the same name
  • -l - Make sure the local variable is unset if you have both a global and local variable of the same name

Parameters[edit]

None

Example[edit]

The most basic usage is to unset a specific variable:

/unset %foobar

Local variables take precedence over a global variable with the same name.

alias global_local {
  set %foo 1
  var %foo 2
  echo -a %foo
  unset %foo
  echo -a %foo
  unset %foo
}

Which will produce the following result:

2
1

/unset can only remove a local or global variable per each name specified, however it’s possible to remove both by specifying the variable name twice, for example:

alias global_local2 {
  set %foo 1
  var %foo 2
    
  ; unset both at once
  unset %foo %foo
  
  ; will print empty quotes
  echo -a $qt(%foo)
}

Which will print empty quotes:

""

No evaluation brackets are needed when unsetting dynamic variables:

alias dynamic_vars {
  var -s %foo. $+ $calc(1+2) Test
  var -s %bar. $+ $calc(1+3) Test
 
  unset -s %foo. $+ $calc(1+2) %bar. $+ $calc(1+3)
}

Which will produce the following results:

* Set %foo.3 to Test
-
* Set %bar.4 to Test
-
* Unset %foo.3
-
* Unset %bar.4

if multiple cleaning

/unset %semple,%foo,%cocorico,%mirc,%ms
alias unset {
  tokenize 44 $1-
  !.unset $*
}

Compatibility[edit]

Added: mIRC v4.0
Added on: 20 Mar 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also[edit]

v · d · e mIRC commands list

A /abook, /action, /add, /ajinvite, /alias, /aline, /ame, /amsg, /anick, /aop, /auser, /auto, /autojoin, /avoice, /away

B /background, /ban, /bcopy, /beep, /bindip, /bread, /break, /breplace, /bset, /btrunc, /bunset, /bwrite

C /channel, /clear, /clearall, /clearial, /cline, /clipboard, /close, /closechats, /closedccs, /closefserves, /closemsg, /cnick, /color, /colour, /comclose, /comlist, /commands, /comopen, /comreg, /continue, /copy, /creq, /ctcp, /ctcpreply, /ctcps

D /dcc, /dccserver, /dde, /ddeserver, /debug, /dec, /describe, /dialog, /did, /didtok, /disable, /disconnect, /dlevel, /dline, /dll, Template:mIRC/donotdisturb, /dns, /dqwindow, /drawcopy, /drawdot, /drawfill, /drawline, /drawpic, /drawrect, /drawreplace, /drawrot, /drawsave, /drawscroll, /drawsize /drawtext

E /ebeeps, /echo, /editbox, /else, /elseif, /emailaddr, /enable, /events, /exit

F /fclose, /filter, /findtext, /finger, /firewall, /flash, /flist, /flood, /flush, /flushini, /fnord, /font, /fopen, /fseek, /fsend, /fserve, /fullname, /fupdate, /fwrite

G /ghide, /gload, /gmove, /gopts, /goto, /gplay, /gpoint, /gqreq, /groups, /gshow, /gsize, /gstop, /gtalk, /gunload, /guser

H /hadd, /halt, /haltdef, /hdec, /hdel, /help, /hfree, /hinc, /hload, /hmake, /hotlink, /hop, /hsave

I /ial, /ialclear, /ialmark, /identd, /if, /ignore, /iline, /inc, /iuser

J /join

L /leave, /linesep, /links, /list, /load, /loadbuf, /localinfo, /log, /logview

M /maxdepth, /mdi, /me, /menubar, /mkdir, /mnick, /mode, /msg

N /noop, /notice, /notify

O /onotice, /omsg

P /pareline, /part, /partall, /pdcc, /perform, /play, /playctrl, /pop, /protect, /proxy, /pvoice

Q /qme, /qmsg, /query, /queryrn, /quit, /quote

R /raw, /registration, /reload, /remini, /remote, /remove, /rename, /renwin, /reseterror, /resetidle, /return, /returnex, /rlevel, /rline, /rmdir, /run, /ruser

S /save, /savebuf, /saveini, /say, /scid, /scon, /server, /set, /setlayer, /showmirc, /signal, /sline, /sockaccept, /sockclose, /socklist, /socklisten, /sockmark, /sockopen, /sockpause, /sockread, /sockrename, /sockudp, /sockwrite, /sound, /speak, /splay, /sreq, /strip, /switchbar

T /timer, /timestamp, /tip, /tips, /titlebar, /tnick, /tokenize, /toolbar, /topic /tray, /treebar

U /ulist, /unload, /unset, /unsetall, /updatenl, /url, /username, /uwho

V /var, /vcadd, /vcmd, /vcrem, /vol

W

X /xyzzy