The description from ^eval in the documentation:
to evaluate a stream as though it were output (like to assign a
variable)
From this I would expect it to replace variable names with their content anywhere in the stream.
But I tested this is only working with if the stream contains only the variablename and no other output.
So
t: $replace=^"\$tobereplaced"
$tobereplaced=testcontent
^eval($replace)
works,
t: $replace=^"some variable: \$tobereplaced"
$tobereplaced=testcontent
^eval($replace)
or
t: $replace=^"\$tobereplaced will not be replaced"
$tobereplaced=testcontent
^eval($replace)
not.
Is this the inteded behavior?
If so no problem, I think I can write code to find all variable names and copy them to a substring, evaluate them and copy them back.
But if not I don’t have to write this code and can do this just with a single call of ^eval