You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var ipt = new Interpreter()
ipt.SetVariable("a", 0);
ipt.SetVariable("b", 10);
ipt.SetVariable("c", 20);
var result = ipt.Eval("a = b + c"); // <= Error: DynamicExpresso.Exceptions.ParseException: 'Expression must be writable (at index 2).'
also tried changing first line to
var ipt = new Interpreter().EnableAssignment(AssignmentOperators.All);
but result is same.
if i remove the assignment it works
var result = ipt.Eval("b + c"); // 30
The text was updated successfully, but these errors were encountered:
Yes, sorry, this is not supported. Variables are "read only". What I think you can do is create a object and assign one of its property. Something like:
var ipt = new Interpreter().EnableAssignment(AssignmentOperators.All);
ipt.SetVariable("registry", someObject);
ipt.SetVariable("b", 10);
ipt.SetVariable("c", 20);
var result = ipt.Eval("registry.a = b + c");
Code
also tried changing first line to
but result is same.
if i remove the assignment it works
The text was updated successfully, but these errors were encountered: