0 votes
by (360 points)
<<set $numberOne = 2>>
<<set $operator = "/">>
<<set $numberTwo = 2>>

<<print $numberOne $operator $numberTwo>> (result = 1)

Can I somehow make it work?

1 Answer

+1 vote
by (63.1k points)
selected by
 
Best answer

You're close. You can use print, specifically, the patented Stupid Print Trick (tm) to force an evaluation: 

<<= '<<set _result to ' + $numberOne + $operator + $numberTwo + '>>' >>
_result (1)

That said, a function or a widget is probably a cleaner way to achieve this. 

Warning: I didn't test this code. It's possible I made a syntax error. 

...