Hi folks
I am trying to implement for or while loops in the expression modifier, but I cant get it to work. Is this a limitation of MMV?
for and while loops in expressions
Re: for and while loops in expressions
Given there is no Magic specific guidance for expressions and Magic doesn't implement all of ExprTk, for things like this you just have to suck it and see.
If a function is implemented you'll get a param error given nothing else. With a unimplemented function you'll get a reserved keyword error. The Magic help says 'logic and maths' which one might argue should include loops but there's probably a good reason it doesn't.
So yes, loops are not available in Magic expressions. However, Increase, Ramp and other modifiers can do much of what a loop would do.
Were you experimenting or trying to achieve something specific. Maybe there's another way.
If a function is implemented you'll get a param error given nothing else. With a unimplemented function you'll get a reserved keyword error. The Magic help says 'logic and maths' which one might argue should include loops but there's probably a good reason it doesn't.
So yes, loops are not available in Magic expressions. However, Increase, Ramp and other modifiers can do much of what a loop would do.
Were you experimenting or trying to achieve something specific. Maybe there's another way.
Re: for and while loops in expressions
thanks a lot for this excellent answer. I did not try anything special. I just wanted to take a deeper dive into the capabilities of the expression modifier, since it is such a powerful feature.