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

m (Bot: Fixing compatibility)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''$&''' allows you to break up long, single script lines in order to make editing and reading them much easier.
+
{{mirc title|$& Identifier}}'''$&''' is a construct which allows you to break up long, single script lines in order to make editing and reading them much easier.
 +
 
 +
'''Note''': $& can touch the end of your line and still be valid, see the example
  
 
== Synopsis ==
 
== Synopsis ==
Line 6: Line 8:
 
== Parameters ==
 
== Parameters ==
 
None
 
None
 
 
== Examples ==
 
== Examples ==
 
'''An alias that breaks up a long echo into multiple lines'''
 
'''An alias that breaks up a long echo into multiple lines'''
 
<source lang="mIRC">alias testit {
 
<source lang="mIRC">alias testit {
   echo -a This is a really long $&
+
   echo -a This is a really long$&
 
     line that is broken up because $&
 
     line that is broken up because $&
 
     mIRC supports it! The cool thing is $&
 
     mIRC supports it! The cool thing is $&
Line 24: Line 25:
 
   }
 
   }
 
}</source>
 
}</source>
 +
 +
Note: Non-spaces are not permitted following it on the same line, and this reports there is no such identifier (unless you create a custom identifier named '&')
 +
<pre>//echo -a foo $& bar</pre>
  
 
== Compatibility ==
 
== Compatibility ==
Line 29: Line 33:
  
 
== See Also ==
 
== See Also ==
[[List of identifiers - mIRC|mIRC Identifiers]]
 
{{mIRC identifier list}}
 
 
[[Category:MIRC identifiers]]
 

Latest revision as of 13:06, 25 April 2023

$& is a construct which allows you to break up long, single script lines in order to make editing and reading them much easier.

Note: $& can touch the end of your line and still be valid, see the example

Synopsis[edit]

$&

Parameters[edit]

None

Examples[edit]

An alias that breaks up a long echo into multiple lines

alias testit {
  echo -a This is a really long$&
    line that is broken up because $&
    mIRC supports it! The cool thing is $&
    that mIRC will also format these $&
    indentations within the script editor!
}

Create an alias that has a code block similar to a programming language

alias testit {
  if ($me isin $+(Hello, $me,! How are you?)) $&
    {
    echo -a This code block resembles some popular programming languages.
  }
}

Note: Non-spaces are not permitted following it on the same line, and this reports there is no such identifier (unless you create a custom identifier named '&')

//echo -a foo $& bar

Compatibility[edit]

Added: mIRC v5.5
Added on: 08 Jan 1999
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also[edit]