OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                           

4.27 FAQ-386 How to avoid substitution in LabTalk?

Last Update: 2/3/2015

Variable with substitution notations, such as $, %, will be resolved to its actual value when the script is executed. This 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. For more details about substitution notations, please refer to this page.


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).

csetvalue f:="Col(A)[i] - %A(Col(B)[U]$)" c:=Col(B);

Keywords:substitution, avoid substitution, turn off substitution


© OriginLab Corporation. All rights reserved.