I'd find it more useful if $v1 and $v2 behaved like local vars, ie their scope is limited to the alias or script they are executed in.
That way the code for v1test is independent of whatever happens in customid.
Or does anyone use these identifiers to get info from other aliases? Maybe i'm just missing something...
Agreed however not using $v1 & $v2 maybe $lv1 $lv2. Since the nature of $v1 & $v2 is already known, changing it would cause (some) scripts to fail.
And yes, I have used these to return values to the calling alias,although I could have done other things this seemed easiest at the time, for what i was doing.
heres an example of one i made.
alias nicks.channels.condition.cmd.failcmd {
var %i = 1
while (%i <= $numtok($1,32)) {
var %l = 1
while (%l <= $numtok($1,32)) {
if ( $gettok($1,%i,32) $3 $gettok($2,%l,32) ) {
return $4
}
inc %l
}
inc %i
}
return $iif($5,$5,.echo -q . $(|,) ;) $iif($null = $null,)
}
could be used like this
$nicks.channels.condition.cmd.failcmd(Dave DaveC Davo,#mirc #mircnet #blah,ison,msg,halt) $v2 $v1 Found ya finally! See my PM please.
!msg $v1 I wanted to talk to you about blah blah blah