From WikiChip
Difference between revisions of "mirc/identifiers/$+"
< mirc‎ | identifiers

(added note about $+())
Line 18: Line 18:
 
Will print (depending on the day of the week):
 
Will print (depending on the day of the week):
 
  ABMonday
 
  ABMonday
 +
 +
This identifier also accepts any number of parameters. The above code can be rewritten (with the same result) as:
 +
<source lang="mIRC">
 +
var %x = A, %y = B
 +
echo -a $+(%x, %y, $day)
 +
</source>
  
 
== See also ==
 
== See also ==

Revision as of 17:23, 23 June 2014

$+ is the concatenation operator in mIRC. The operator can join together two strings end-to-end. In addition to its normal behavior, the $+ operator has a few special functions when used within evaluation brackets.

In its normal use, the $+ operator can be used to join together two strings end-to-end. For example:

echo -a A $+ B $+ C

Will result in:

 ABC

Likewise, the $+ operator can be used with identifiers and variables as well:

var %x = A, %y = B
echo -a %x $+ %y $+ $day

Will print (depending on the day of the week):

ABMonday

This identifier also accepts any number of parameters. The above code can be rewritten (with the same result) as:

var %x = A, %y = B
echo -a $+(%x, %y, $day)

See also