Flee icon indicating copy to clipboard operation
Flee copied to clipboard

Evaluate returns false and doesn't set property value

Open gbanusi opened this issue 7 years ago • 1 comments

I'm trying to execute this:

IDynamicExpression eDynamic = engineContext.CompileDynamic("Object.Width = 0.20"); var res = eDynamic.Evaluate(); ,

but for some reason, "res" is false and evaluation doesn't set anything. Is setting variable property value allowed?

gbanusi avatar Sep 17 '18 12:09 gbanusi

The "=" is used as an Equality Comparison operator (==) to support expressions that use this by default. You could try to override the operator (see #54 for an example).

So by default it will return false if you're trying to set it to a new value, because it sees it as: OldValue == NewValue which is most likely false.

Doc-Saintly avatar Mar 27 '19 07:03 Doc-Saintly