mIRC Homepage
Posted By: tidy_trax $for() - 29/02/04 09:38 PM
Code:
execute { return $1- }
for {
  execute $1
  if $right($3,2) == ++ { var %type inc } 
  elseif $right($3,2) == -- { var %type dec }
  while $gettok($2,1,32) $gettok($2,2,32) $gettok($2,3,32) { 
    %type $left($3,-2)
    execute $4-
  }
}

typing:
//.echo -q $for(var %x 1,%x <= 10,%x++,echo -s %x)
gives the following error:
-
* /while: '10' unknown operator (line 13, aliases.ini)
-
anyone know why?
Posted By: greeny Re: $for() - 01/03/04 12:40 PM
because your variables are evaluated before they are passed to the alias.
Posted By: Adrenalin Re: $for() - 01/03/04 12:50 PM
if after elseif $right($3,2) == -- { var %type dec } i put echo -set $gettok($2,1,32) $gettok($2,2,32) $gettok($2,3,32) in the status i see <= 10..
So error cause of the error is While <= 10..

And //.echo -q $for(var %x 1,%x <= 10,%x++,echo -s %x) must be //echo $for($eval(var %x 1,0),$eval(%x <= 10,0),$eval(%x++,0),$eval(echo -s %x,0))
Posted By: Adrenalin Re: $for() - 01/03/04 01:12 PM
Here is you alias..
Nice parser grin
Code:
for {
  if $right($eval($3,1),2) == ++ { var %type inc }
  elseif $right($eval($3,1),2) == -- { var %type dec }
  set $eval($left($eval($3,1),-2),1) 0 | ;For some reson.. Var don't work here..
  while $eval($gettok($2,1,32),2) $eval($gettok($2,2,32),2) $eval($gettok($2,3,32),2) {
    $eval($4-,2)
    %type $left($eval($3,1),-2)
  }
}

//echo $for($eval(var %x 1,0),$eval(%x <= 10,0),$eval(%x++,0),$eval(echo -s %x,0))
Show to me

0
1
2
3
4
5
6
7
8
9
10
© mIRC Discussion Forums