Note: $1- is built by tokenizing the parameters/text, which means that leading/trailing/consecutive spaces are lost, see $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.
You can use $0 to return the total number of words or the total number of parameters.
You can stick text to $1, $2 etc without using $+, as long as your text does not contain a digit, for example:
//tokenize 32 Khaled | echo -a $1's skills are impressive!If your text contains a number, mIRC skips every character in your text up to the last number and use the remaining text.
Note: if the value of $1 is $null, then $null is returned, instead of the text itself
$1- returns the full line/parameters because '-' is actually used to set a range.
By adding a number after the '-' character, you can get multiple consecutive word/parameter, $1-2 returns from the first word/parameter to the second word/parameter.
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
When using certain Tokens function such as $gettok, you can sometimes use a range for the N parameter, in this case you can specify a range too, but with an extra feature, both number can be negative.
Negative numbers means that mIRC looks from the end instead of the start:
$gettok(A B C D E F,-1,32) returns B, the first word starting from the end $gettok(A B C D E F,-2-,32) returns E F, from the second word starting from the end, and then the last '-' means 'onward' as usual $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
Added: mIRC v2.1a
Added on: 28 Feb 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.