Parse in substituteIn Substitute, if I don't have a fixed number of symbols, is it possible to use a for loop and parse to generate the symbol names?
Something is wrong here:
myExpr=Expr(sum());
For( i=1, i<=10, i++, Insert Into (myExpr,parse("__x"||Char(i)||"__")));
Show(NameExpr(myExpr));
For( i=1, i<=10, i++, substitute (Name Expr(myExpr),parse("__x"||Char(i)||"__"),parse("y"||Char(i))));
Show(NameExpr(myExpr));Automation and ScriptingRe: Parse in substituteYou aren't updating the value of myExpr
Names Default To Here(1);
myExpr = Expr(Sum());
For(i = 1, i <= 10, i++,
Insert Into(myExpr, Parse("__x" || Char(i) || "__"))
);
Show(Name Expr(myExpr));
For(i = 1, i <= 10, i++,
myExpr = Substitute(Name Expr(myExpr), Parse("__x" || Char(i) || "__"), Parse("y" || Char(i)))
);
Show(Name Expr(myExpr));Re: Parse in substituteoh, so close!