From WikiChip
Editing mirc/identifiers/$1-
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | {{mirc title|$1- Identifier}}The '''$1-''' identifier returns a list of argument passed to an alias or returns the text message associated with an {{mIRC|on events|mSL Events}}. $1- is also filled by the {{mIRC|/tokenize}} command | + | {{mirc title|$1- Identifier}}The '''$1-''' identifier returns a list of argument passed to an alias or returns the text message associated with an {{mIRC|on events|mSL Events}}. $1- is also filled by the {{mIRC|/tokenize}} command. |
− | '''Note''': $1- is built by tokenizing the parameters/text, which means that leading/trailing/consecutive spaces are lost, see {{mIRC|$parms}}, which is the same as $1-, but preserves spaces | + | '''Note''': $1- is built by tokenizing the parameters/text, which means that leading/trailing/consecutive spaces are lost, see {{mIRC|$parms}}, which is the same as $1-, but preserves spaces. |
If $1- represents the full line/parameters, you can use $1 to only reference the first parameter/word, you can use $2 to reference the second parameter/word and so on. | If $1- represents the full line/parameters, you can use $1 to only reference the first parameter/word, you can use $2 to reference the second parameter/word and so on. | ||
Line 7: | Line 7: | ||
You can use $0 to return the total number of words or the total number of parameters. | You can use $0 to return the total number of words or the total number of parameters. | ||
− | You can | + | You can stick text to $1, $2 etc without using {{mIRC|$+}}, as long as your text does not contain a digit, for example: |
<syntaxhighlight lang="mirc"> | <syntaxhighlight lang="mirc"> | ||
//tokenize 32 Khaled | echo -a $1's skills are impressive! | //tokenize 32 Khaled | echo -a $1's skills are impressive! | ||
− | </syntaxhighlight>If your | + | </syntaxhighlight>If your text contains a number, mIRC skips every character in your text up to the last number and use the remaining text. |
− | |||
− | |||
− | |||
− | |||
− | |||
'''Range''' | '''Range''' | ||
Line 25: | Line 20: | ||
So $1- means from the first word/parameter to the last/parameter, aka from the first word onward and $3- is from the third word/parameter onward. | So $1- means from the first word/parameter to the last/parameter, aka from the first word onward and $3- is from the third word/parameter onward. | ||
− | + | ||
− | |||
− | |||
− | |||
== Range in Token functions == | == Range in Token functions == | ||
Line 39: | Line 31: | ||
$gettok(A B C D E F,-2--5,32) returns B C D E, from the second word starting from the end, to the 5th word, starting from the end | $gettok(A B C D E F,-2--5,32) returns B C D E, from the second word starting from the end, to the 5th word, starting from the end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | == Synopsis == | ||
+ | <pre>$1-</pre> | ||
+ | |||
+ | == Properties == | ||
+ | None | ||
== Examples == | == Examples == | ||
Line 44: | Line 43: | ||
on *:text:*:#:echo -s $nick said $1- | on *:text:*:#:echo -s $nick said $1- | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == | ||
{{mIRC compatibility|2.1a}} | {{mIRC compatibility|2.1a}} | ||
+ | |||
== See Also == | == See Also == | ||
+ | |||
+ | [[Category:mIRC identifiers|1-]] |