mIRC Homepage

$v1 and $ifmatch question

Posted By: Canario

$v1 and $ifmatch question - 20/11/06 11:16 PM

Code:
alias save.cfg {
  if (3 isnum) echo -a hadd -m $prot.hss txt.ft $v1
}
alias prot.hss {
  if ($dialog(chanprot)) && ($did(chanprot,5).seltext) return $+(chanprot.,$v1)
  else { return chanprot.Global }
}


I think that $v1 or $ifmatch must return 3, but in this case for some reason doesnīt return anything. I can see that another times, somebody knows why? I donīt understand smirk
Posted By: jaytea

Re: $v1 and $ifmatch question - 20/11/06 11:47 PM

$v1 is carried over from aliases to ones that called them, so when $prot.hss evaluates, since it contains an if statement, the value of $v1 is changed from that point on. what you can do is make sure $v1 evaluates before $prot.hss:

Code:
if (3 isnum) echo -a hadd -m $prot.hss txt.ft [ $v1 ]


look at /help brackets
Posted By: DaveC

Re: $v1 and $ifmatch question - 20/11/06 11:50 PM

in the /SAVE.CFG alias the echo well return the $v1 of the LAST IF or $IIF or WHILE comparasion, which in the echo lines case is the comparision that occured inside the $PROT.HSS alias

to fix.....
alias save.cfg { if (3 isnum) echo -a hadd -m $prot.hss txt.ft [ $v1 ] }

The above correction well correct this problem, the [ ] are evaluation order control brackets, these tell mirc to evaluate this value before the others, and well result in the $v1 value from the /IF (3 ISNUM) comparision, being evaluated to replace the $v1
Posted By: DaveC

Re: $v1 and $ifmatch question - 20/11/06 11:51 PM

pffft beat me to it!
Posted By: Canario

Re: $v1 and $ifmatch question - 21/11/06 04:23 AM

Thabks a lot!
© 2021 mIRC Discussion Forums