. . . and here's an alternative using column properties:
NamesDefaultToHere(1);
// Make a table with some random data
dt = NewTable("Charts");
n = 5;
dt << addMultipleColumns("C_", n, Numeric);
dt << addRows(20);
for(c=1, c<=n, c++, Column(dt, "C_"||Char(c)) << formula(RandomNormal(0, 1)));
dt << runFormulas;
// Put the charts into a single window
nw1 = New Window ("Control Charts",
For( c = 1, c <= n, c++,
thisCC = dt << Control Chart(
Group Size( 1 ),
KSigma( 3 ),
Chart Col(Column(dt, "C_"||Char(c))),
Chart Type( Moving Range )
);
// Save the computed limits as a column property
thisCC << inColumn;
);
);
// Make a blank limits table
dt2 = NewTable("Limts",
NewColumn("Column", Character),
NewColumn("Avg", Numeric),
NewColumn("LCL", Numeric),
NewColumn("UCL", Numeric),
<< addRows(n)
);
// Populate the limits table by parsing the saved column property
For( c = 1, c <= n, c++,
clExpr = Column(dt, "C_"||Char(c)) << getProperty("Control Limits");
Column(dt2, "Column")[c] = "C_"||Char(c);
Column(dt2, "Avg")[c] = Arg(Arg(Arg(clExpr, 1), 1), 1);
Column(dt2, "LCL")[c] = Arg(Arg(Arg(clExpr, 1), 2), 1);
Column(dt2, "UCL")[c] = Arg(Arg(Arg(clExpr, 1), 3), 1);
);
I suspect this might be simpler with Control Chart Builder, but I didn't check (and you may have reasons for using the 'old' platform anyway).