TestColSet

Checks to see if a single (or part of a single) dataset is selected. If so, nothing is done. If not, the currently executing script is terminated.

 

Definition:

Def TestColSel {
      if (exist(%C)!=1 || SelC2 > SelC1) {

           type -b "$general.Only1YColumn";
            break 1;
      };
};

Example:

The following script checks to see if a single dataset is selected. If so, it integrates the selected dataset and prints the results in the Script window. If not, an error message is printed out and the script is terminated.

TestColSel;
integ %C;
if (MkS1>=0) {
      i1=MkS1;
      i2=MkS2;
}
else 
{
      get %C -b i1;
      get %C -e i2;
};
ty -a Integ of %C from zero;
ty "i = $(i1) --> $(i2)";
ty "x = $(integ.x1) --> $(integ.x2)";
ty "Area    Peak at    Width    Height";
ty "$(integ.area)    $(integ.x0)    $(integ.dx)    $(integ.y0)";