Page 1 of 1

Can't do ${} stuff to access array elements

Posted: Fri Apr 23, 2004 10:39 pm
by OldNecro
Just quick FYI...

/define KitePath array2

@KitePath(@Param0,${Math.Calc[@i+1]}),@KitePath(@Param0,@i))

...caused me to lose a couple pretty decent-sized clumps of hair.

The parser does *not* like to evaluate MQ2Data calls while referencing array elements...

quick fix...

/varset tmpy ${Math.Calc[@i+1]}
@KitePath(@Param0,@tmpy),@KitePath(@Param0,@i)

-OldNecro

Posted: Fri Apr 23, 2004 10:47 pm
by ml2517
Yep, Lax already knows about this. I discovered it about a week ago.

Posted: Fri Apr 23, 2004 11:55 pm
by Lax
work around it for now by doing a /varset on a temporary variable first, or something. When MQ2DataVars goes live you wont see any issues like this anymore. The problem is that there's 2 different parsers right now.. one for @variable and one for ${}. When MQ2DataVars is live, there will be 1 parser, and will only use ${}. That will eliminate all current problems with @variable.