Maroonbells (talk | contribs) (New content for empty stub) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | '''$puttok replaces the Nth $asc(C)-delimited token in a list | + | {{mirc title|$puttok identifier}}'''$puttok''' replaces the Nth $asc(C)-delimited token in a list. |
== Synopsis == | == Synopsis == | ||
Line 13: | Line 13: | ||
== Properties == | == Properties == | ||
− | |||
None | None | ||
== Examples == | == Examples == | ||
− | + | <source lang=mirc>//echo -a $puttok(a-b-c-d-e-f,TEST,3,46)) | |
− | < | + | ; returns a-b-TEST-d-e-f</source> |
− | ; returns a-b-TEST-d-e-f</ | ||
Shows the unchanged path with the filename changed to TEST.TXT: | Shows the unchanged path with the filename changed to TEST.TXT: | ||
− | < | + | <source lang=mirc>//echo -a $puttok($mircexe,TEST.TXT,-1,92))</source> |
− | < | + | <source lang=mirc>//echo -a $puttok(x11xx33X44x55x66x,TEST,3,120) |
; returns 11x33X44xTESTx66 | ; returns 11x33X44xTESTx66 | ||
− | ; because leading/trailing/duplicate delimiters are removed before evaluating <LIST>. $chr(120) is lower-case x so the capital X is not a delimiter.</ | + | ; because leading/trailing/duplicate delimiters are removed before evaluating <LIST>. $chr(120) is lower-case x so the capital X is not a delimiter.</source> |
− | ''' | + | '''Note:''' Unlike CSV format, if C=44 to delimit with commas, double-quotes around filename containing a comma does not allow the entire filename to be a single token. If you want $filename to be a token in a comma-delimited list of tokens, you should use {{mIRC|$replace|$replace}} to change the comma in the filename into another character that cannot appear in the filename before adding as a token, then use {{mIRC|$replace|$replace}} on the extracted token to restore any comma(s). |
== Compatibility == | == Compatibility == | ||
Line 35: | Line 33: | ||
== See also == | == See also == | ||
+ | * {{mIRC|$addtok}} | ||
+ | * {{mIRC|$deltok}} | ||
+ | * {{mIRC|$findtok}} | ||
* {{mIRC|$gettok}} | * {{mIRC|$gettok}} | ||
+ | * {{mIRC|$instok}} | ||
+ | * {{mIRC|$istok}} | ||
+ | * {{mIRC|$matchtok}} | ||
* {{mIRC|$numtok}} | * {{mIRC|$numtok}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* {{mIRC|$remtok}} | * {{mIRC|$remtok}} | ||
* {{mIRC|$reptok}} | * {{mIRC|$reptok}} | ||
* {{mIRC|$sorttok}} | * {{mIRC|$sorttok}} | ||
+ | * {{mIRC|$wildtok}} | ||
* [[List of identifiers - mIRC]] | * [[List of identifiers - mIRC]] | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
+ | [[Category:mIRC identifiers|puttok]] |
Latest revision as of 07:05, 21 September 2017
$puttok replaces the Nth $asc(C)-delimited token in a list.
Synopsis[edit]
$puttok(<LIST>,<Token Data>,<N>,<C>)
Parameters[edit]
LIST: - Text list delimited by a character into tokens
Token Data: - Replacement text which overwrites the existing Nth token
N: - The token number to be overwritten
C: - The $asc() value which splits TEXT into tokens
If N is negative, returns tokens relative to the last token. -1 is the last token, -2 is next-to-last token, etc.
Properties[edit]
None
Examples[edit]
//echo -a $puttok(a-b-c-d-e-f,TEST,3,46)) ; returns a-b-TEST-d-e-f
Shows the unchanged path with the filename changed to TEST.TXT:
//echo -a $puttok($mircexe,TEST.TXT,-1,92))
//echo -a $puttok(x11xx33X44x55x66x,TEST,3,120) ; returns 11x33X44xTESTx66 ; because leading/trailing/duplicate delimiters are removed before evaluating <LIST>. $chr(120) is lower-case x so the capital X is not a delimiter.
Note: Unlike CSV format, if C=44 to delimit with commas, double-quotes around filename containing a comma does not allow the entire filename to be a single token. If you want $filename to be a token in a comma-delimited list of tokens, you should use $replace to change the comma in the filename into another character that cannot appear in the filename before adding as a token, then use $replace on the extracted token to restore any comma(s).
Compatibility[edit]
Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
- $addtok
- $deltok
- $findtok
- $gettok
- $instok
- $istok
- $matchtok
- $numtok
- $remtok
- $reptok
- $sorttok
- $wildtok
- List of identifiers - mIRC