From WikiChip
Difference between revisions of "mirc/identifiers/$numtok"
(→Examples) |
|||
Line 16: | Line 16: | ||
Echo to the active window, the number of tokens delimited by the $chr(45) hyphen: | Echo to the active window, the number of tokens delimited by the $chr(45) hyphen: | ||
− | < | + | <source lang=mirc>//echo -a $numtok(a-b-c-d-e,45) |
− | ; returns 5</ | + | ; returns 5</source> |
− | < | + | <source lang=mirc>//echo -a $numtok(1x2x3x4,120) |
; returns 4 because $chr(120) is lower-case x | ; returns 4 because $chr(120) is lower-case x | ||
//echo -a $numtok(x1xxxx2x3x4x,120) | //echo -a $numtok(x1xxxx2x3x4x,120) | ||
; also returns 4 because duplicate, leading, and trailing delimiters are stripped before $numtok processes the LIST | ; also returns 4 because duplicate, leading, and trailing delimiters are stripped before $numtok processes the LIST | ||
//echo -a $numtok(1x2X3x4,120) | //echo -a $numtok(1x2X3x4,120) | ||
− | ; returns 3 because the C token is case-sensitive, so capital X isn't a delimiter | + | ; returns 3 because the C token is case-sensitive, so capital X isn't a delimiter |
− | </ | + | </source> |
== Compatibility == | == Compatibility == |
Revision as of 19:38, 17 June 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$numtok returns the number of $asc(C)-delimited token in a list.
Synopsis
$numtok(<LIST>,<C>)
Parameters
LIST: - Text list delimited by a character into tokens
C: - The $asc() value which splits LIST into tokens
Properties
None
Examples
Echo to the active window, the number of tokens delimited by the $chr(45) hyphen:
//echo -a $numtok(a-b-c-d-e,45) ; returns 5
//echo -a $numtok(1x2x3x4,120) ; returns 4 because $chr(120) is lower-case x //echo -a $numtok(x1xxxx2x3x4x,120) ; also returns 4 because duplicate, leading, and trailing delimiters are stripped before $numtok processes the LIST //echo -a $numtok(1x2X3x4,120) ; returns 3 because the C token is case-sensitive, so capital X isn't a delimiter
Compatibility
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
- $gettok
- $findtok
- $matchtok
- $wildtok
- $istok
- $addtok
- $instok
- $puttok
- $deltok
- $remtok
- $reptok
- $sorttok
- List of identifiers - mIRC
mIRC identifier list