mIRC Home    About    Download    Register    News    Help

Print Thread
#50239 19/09/03 05:30 AM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
//echo .... $eval(($calc(1)),2)
Echos ($calc(1))
//echo .... $eval(( $calc(1) ),2)
Echos ( 1 )
//echo .... $eval(( $calc(1)),2)
Breaks

//echo .... $eval(( $calc(1)),2)
* Invalid format: $evalnext

I take it the script takes $eval and wraps it in whatever number given of '$evalnext()'s they really shouldn't break if they are recursively set by the script itself.

//echo .... $eval( $calc(1))),2)
Echos 1

Just fyi, I am trying to run a line like:
//timer 1 0 $eval(if ((2 != $calc(1+1)) msg $chan The world is ending 1 plus 1 doesn't equal $calc(1+1),2)

Which isn't totally outlandish, although it is quite odd...

Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
I'm not sure if I understood your post. But all I'm seeing here are parenthesis mismatches.

Note that anything next to the closing paranthesis of an identifier (after it) is removed by the parser (for example, in "$window(*,0))()blah,123", ")()blah,123" is removed).
That said:

($eval - string going to be evaluated - identifier going to be evaluated)


$eval([color:green]($calc(1)),2)[/color] echoes "($calc(1))", which is fine;
$eval([color:green]( [color:blue]$calc(1) )[/color],2)[/color] echoes "( 1 )", which is fine;
$eval([color:green]( [color:blue]$calc(1))[/color],2)[/color] would be evaluated to $eval([color:green]( 1,1)[/color], which mismatches the parenthesis and breaks for invalid format;
$eval([color:blue] $calc(1))),2)[/color] echoes "1", which is fine;

$eval([color:green]if ((2 != [color:blue]$calc(1+1)) msg $chan The world is ending 1 plus 1 doesn't equal $calc(1+1)[/color],2)[/color]
..would be evaluated to..
$eval([color:green]if ((2 != 2 msg #blah The world is ending 1 plus 1 doesn't equal 2,1)[/color]
..which mismatches the parenthesis and breaks for invalid format.


So, unless you're meaning that $eval() shouldn't consider parenthesis mismatches, it seems all your examples are working as expected.

Last edited by cold; 20/09/03 03:35 PM.

* cold edits his posts 24/7
Joined: Oct 2003
Posts: 11
R
Pikka bird
Offline
Pikka bird
R
Joined: Oct 2003
Posts: 11
however, as noted in a previous post, it also messes up when there is a single parenthesis in a variable name it is meant to evaluate, which it should not. the same is true when you are trying to evaluate $1-.... once again, which it should not be.

ie. while in a chan with a single parenthesis in its name, do
//set -s $+(%,test,#) value | echo -a $eval($+(%,test,#),3)

say, in #kasjb, you get:
* Set %test#kasjb( to value
* Invalid format: $evalnext

this should not happen. it should happen if you type in the wrong amount of parenthesis, but NOT if the value is gotten from a %var or from $1- etc.


^------rintaun irl

Link Copied to Clipboard