Avoid-Substituted
Last Update: 3/31/2023
Variable with substitution notations, such as $, %, will be resolved to its actual value in Labtalk Script or in Legend.
When the script is executed. variable substitution will cause trouble if you need the script run more than one time. To avoid this situation you can assign the special substitution notation to a String register instead of using it directly.
Example:
The following script will set the formula in the Set Values dialog of Col (B) to Col(A)[i] - %(Col(B)[U]$) without letting %(Col(B)[U]$) be substituted by the Units value of Col(B).
%A="%"; csetvalue f:="Col(A)[i] - %A(Col(B)[U]$)" c:=Col(B);
Substitution notation in legend will render it's actual value. For example, character \ or % in legend that may render unexpected strings. To avoid the situation, you can use escape sequences \v().
Keywords:substitution, avoid substitution, turn off substitution