View Full Version : Is this possible? Mel

08-15-2012, 02:39 AM
Is there a way to do something like this in mel? I want to save some unnecessary code for a script by using a variable instead of harcoding <= >= == < > for each different scenario.

string $Operation = "<";
if (1 $Operation 2) {print "Yes";}

Thanks for any ideas!

08-15-2012, 04:58 AM
Build an expression string and use eval():

eval("$b = 1 < 2")

08-15-2012, 02:25 PM
thanks eval is great!

CGTalk Moderation
08-15-2012, 02:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.