After some tests, I realised that $eval() takes all it's parameters except LAST and evaluates them as many times as last parameter says. If you use only one parameter for expression and one to specify how many times to evaluate everything works fine.
For example,
//echo -a $eval($!ip,0)
outputs "$!ip"
//echo -a $eval($!ip,1)
outputs "$ip"
//echo -a $eval($!ip,2)
outputs my ip address
However, if you try to use more parameters for expressions, things break when you evaluate more than once
//echo -a $eval($!ip, $!ip, 0)
outputs "$!ip $!ip" (just as it should, each parameter evaluated 0 times)
//echo -a $eval($!ip, $!ip, 1)
outputs "$ip $ip" (just as it should, each parameter evaluated once)
//echo -a $eval($!ip, $!ip, 2)
outputs "$ip $ip" (it should output my ip twice separated by space, but the two expressions are evaluated once each, instead twice each. I also tried using bigger numbers for evaluation, same behaviour)

Edit:
I also tried it on 6.16, in this version only the first used expression is evaluated only once, further expressions are evaluated correctly
//echo -a $($!os,$!os,$!os,0)
outputs "$!os $os $os"
//echo -a $($!os,$!os,$!os,2)
outputs "$os XP XP"

Last edited by stefys99; 08/09/06 03:26 PM.