From WikiChip
Difference between revisions of "mirc/identifiers/$v1"
< mirc‎ | identifiers

m
m
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''$v1''' identifier returns the value of the lefthand operand of the most recently checked conditonal statement within a script. This identifier is equivalent to the [[$ifmatch identifier - mIRC|$ifmatch]] identifier.
+
{{mirc title|$v1 Identifier}}'''$v1''' returns the value of the left-hand operand of the most recently executed conditional statement. This identifier is equivalent to the deprecated {{mIRC|$ifmatch}} identifier.
  
==Synopsis==
+
 
 +
== Synopsis ==
 
<pre>$v1</pre>
 
<pre>$v1</pre>
  
==Examples==
+
== Parameters ==
 +
None
 +
 
 +
== Properties ==
 +
None
 +
 
 +
== Notes ==
 +
Just like $ifmatch, $v2 and $ifmatch2, this identifier returns one of the operands from the last conditional statement executed. Conditional statements include:
 +
* {{mirc|/if}}
 +
* {{mirc|$iif}}
 +
* {{mirc|/while}}
 +
 
 +
<source lang="mIRC">
 +
alias test return $iif($1 == 1,1,2)
 +
alias testing if (a != b) echo -a $test(1) $v1
 +
</source>
 +
This will echo 1 for $v1 instead of "a" because $test is evaluated before $v1, so the $iif is the last statement made when $v1 evaluates.
 +
 
 +
== Examples ==
 
List the names of any hash tables currently in use upon calling an alias '''/hlist''':
 
List the names of any hash tables currently in use upon calling an alias '''/hlist''':
 
<source lang="mirc">alias hlist {
 
<source lang="mirc">alias hlist {
Line 16: Line 35:
 
   echo -qgaec i End of /hlist.
 
   echo -qgaec i End of /hlist.
 
}</source>
 
}</source>
 
  
 
Check if two random numbers between 1 and 5 are equivalent, and echo the matching numbers if so:
 
Check if two random numbers between 1 and 5 are equivalent, and echo the matching numbers if so:
 
<source lang="mirc">//echo -ga $iif($rand(1,5) == $rand(1,5),Yes! $v1 == $v2,No! $v1 != $v2) $+ !</source>
 
<source lang="mirc">//echo -ga $iif($rand(1,5) == $rand(1,5),Yes! $v1 == $v2,No! $v1 != $v2) $+ !</source>
  
==Compatibility==
+
== Compatibility ==
Added: v6.16
+
{{mIRC compatibility|6.16}}
 
 
Added on: 07/07/2004
 
  
==See Also==
+
== See also ==
 
*[[Conditional statements - mIRC|If then else]]
 
*[[Conditional statements - mIRC|If then else]]
*[[While Loops - mIRC|While loops]]
+
*{{mIRC|While loops}}
*[[$v2 identifier - mIRC|$v2]]
+
*{{mIRC|$v2}}
*[[$ifmatch identifier - mIRC|$ifmatch]]
+
*{{mIRC|$ifmatch}}
*[[$ifmatch2 identifier - mIRC|$ifmatch2]]
+
*{{mIRC|$ifmatch2}}
 +
*{{mirc|/if}}
 +
*{{mirc|$iif}}
 +
*{{mirc|/while}}
 +
{{mIRC identifier list}}
  
[[Category:mIRC Identifiers]]
+
[[Category:mIRC identifiers|v1]]

Latest revision as of 18:12, 22 September 2017

$v1 returns the value of the left-hand operand of the most recently executed conditional statement. This identifier is equivalent to the deprecated $ifmatch identifier.


Synopsis[edit]

$v1

Parameters[edit]

None

Properties[edit]

None

Notes[edit]

Just like $ifmatch, $v2 and $ifmatch2, this identifier returns one of the operands from the last conditional statement executed. Conditional statements include:

alias test return $iif($1 == 1,1,2)
alias testing if (a != b) echo -a $test(1) $v1

This will echo 1 for $v1 instead of "a" because $test is evaluated before $v1, so the $iif is the last statement made when $v1 evaluates.

Examples[edit]

List the names of any hash tables currently in use upon calling an alias /hlist:

alias hlist {
  if (!$hget(0)) { echo -qgaec i * No hash tables in use }
  else {
    var %i 1
    while ($hget(%i) != $null) {
      echo -ga $v1
    }
  }
  echo -qgaec i End of /hlist.
}

Check if two random numbers between 1 and 5 are equivalent, and echo the matching numbers if so:

//echo -ga $iif($rand(1,5) == $rand(1,5),Yes! $v1 == $v2,No! $v1 != $v2) $+ !

Compatibility[edit]

Added: mIRC v6.16
Added on: 07 Jul 2004
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