|
|
(7 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | {{mirc title|$istok Identifier}}'''$istok''' returns $true if a matching token exists, or $false if it does not. | + | {{mirc title|$istok identifier}}'''$istok''' returns $true if a matching token exists, or $false if it does not. |
| | | |
| | | |
Line 16: |
Line 16: |
| | | |
| == Examples == | | == Examples == |
− | <pre>//if ($event isin CONNECT JOIN) goto LABEL</pre> | + | <pre>//if ($event isin DISCONNECT JOIN) goto LABEL</pre> |
| | | |
− | If this alias is executed in the {{mIRC|on events/on CONNECT|ON CONNECT}} and {{mIRC|on events/on DISCONNECT|ON DISCONNECT}} events, this triggers on BOTH events because {{mIRC|isin|isin}} matches on CONNECT being a substring of DISCONNECT. Better is: | + | If this alias is executed in the {{mIRC|on connect}} and {{mIRC|on disconnect}} events, this triggers on BOTH events because {{mIRC|isin|isin}} matches on CONNECT being a substring of DISCONNECT. Better is: |
| <pre>//if ($istok(CONNECT JOIN,$event,32)) goto LABEL | | <pre>//if ($istok(CONNECT JOIN,$event,32)) goto LABEL |
| ; searches for exact match of the value of the $event string against the tokens in the space-delimited list of tokens. | | ; searches for exact match of the value of the $event string against the tokens in the space-delimited list of tokens. |
Line 29: |
Line 29: |
| <pre>//echo -a $asctime($ctime,dddd) $istok(SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY,$asctime($ctime,dddd),32) | | <pre>//echo -a $asctime($ctime,dddd) $istok(SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY,$asctime($ctime,dddd),32) |
| ; returns $true because match is case-insensitive | | ; returns $true because match is case-insensitive |
− | </pre>
| |
− |
| |
− | '''Note:''' Even though {{mIRC|$upper|$upper}} and {{mIRC|$lower|$lower}} treat $chr(201) and $chr(233) as UPPER/lower forms of the same letter, $istok does not return $true when trying to match these 2 characters:
| |
− |
| |
− | <pre>//var %name Chlo $+ $chr(233) | echo -a %name $istok($upper(%name) Suzy,%name,32)
| |
− | ; returns false because the case-insensitive search does not match $chr(233) against $chr(201)
| |
− | </pre>
| |
− |
| |
− | To have CHLOÉ and chloé both match as $true, use {{mIRC|$upper|$upper(TOKEN)}} and a capitalized LIST:
| |
− |
| |
− | <pre>//var %name Chlo $+ $chr(233) | echo -a %name $istok(CHLO $+ $chr(201) Suzy,$upper(%name),32)
| |
− | ; returns $true because $upper converted $chr(233) to $chr(201)
| |
| </pre> | | </pre> |
| | | |
Line 47: |
Line 35: |
| | | |
| == See also == | | == See also == |
− | * {{mIRC|$istokcs}} | + | * {{mIRC|$addtok}} |
| + | * {{mIRC|$deltok}} |
| + | * {{mIRC|$findtok}} |
| * {{mIRC|$gettok}} | | * {{mIRC|$gettok}} |
| + | * {{mIRC|$instok}} |
| + | * {{mIRC|$istok}} |
| + | * {{mIRC|$matchtok}} |
| * {{mIRC|$numtok}} | | * {{mIRC|$numtok}} |
− | * {{mIRC|$findtok}}
| |
− | * {{mIRC|$matchtok}}
| |
− | * {{mIRC|$wildtok}}
| |
− | * {{mIRC|$addtok}}
| |
− | * {{mIRC|$instok}}
| |
| * {{mIRC|$puttok}} | | * {{mIRC|$puttok}} |
− | * {{mIRC|$deltok}}
| |
| * {{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|istok]] | | [[Category:mIRC identifiers|istok]] |
Latest revision as of 11:38, 2 May 2020
$istok returns $true if a matching token exists, or $false if it does not.
Synopsis[edit]
$istok(<LIST>,<Token>,<C>)
Parameters[edit]
LIST: - Text list delimited by a character into tokens
Token: - The token searched for in LIST
C: - The $asc() value which splits TEXT into tokens
The search is for entire token, not partials, and the search is NOT case-sensitive. If you need the token search to be case-sensitive, use $istokcs which has the same syntax}}
Properties[edit]
None
Examples[edit]
//if ($event isin DISCONNECT JOIN) goto LABEL
If this alias is executed in the on connect and on disconnect events, this triggers on BOTH events because isin matches on CONNECT being a substring of DISCONNECT. Better is:
//if ($istok(CONNECT JOIN,$event,32)) goto LABEL
; searches for exact match of the value of the $event string against the tokens in the space-delimited list of tokens.
//var %filename spreadsheet.xls | var %filetype $gettok($noqt(%filename),-1,46) | echo -a %filetype $istok(xlsx xlsm,%filetype,32)
; returns false because $istok does not match the substring xls against the token xlsx
//echo -a $asctime($ctime,dddd) $istok(SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY,$asctime($ctime,dddd),32)
; returns $true because match is case-insensitive
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]
v · d · e mIRC identifier list
$
$$, $, $0, $1-, $!, $&, $*, $+, $++, $?
A
$abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime
|
B
$banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes
C
$calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter
|
D
$date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration
E
$ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting
|
F
$false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen
|
G
$get, $getdir, $getdot, $gettok, $gmt, $group
H
$halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot
|
I
$iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf
|
K
$keychar, $keyrpt, $keyval, $knick
L
$lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer
|
M
$maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags
|
N
$N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick
O
$ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os
|
P
$parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok
Q
$qt, $query
R
$r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round
|
S
$samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir
|
T
$tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust
U
$ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode
V
$v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol
|
W
$wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap
|
X
$xor
Y
$yes
|
Z
$zip
=
=$nick
|