This code works because I am explicitly writing ":WaferID" inside of the Where(...) clause:
// Example Parameters
colParaList = {Column(dt, "Para1"), Column(dt, "Para2"), Column(dt, "Para3")};
splitPara = Column(dt, "Site");
byPara = Column(dt, "WaferID");
byParaValues = Associative Array(byPara) << GetKeys();
New Window("Test", vlb = V List Box(
dt << Fit Group(
For(iC = 1, iC <= NItems(colParaList), iC++,
Oneway(Y(Eval(colParaList[iC])), X(splitPara)) ),
<< {Arrange in Rows(1)},
Where(:WaferID == "001"),
SendToReport( Dispatch( {}, "Fit Group WaferID=001", OutlineBox, {Close( 1 )} ) ) ))
);
This code doesn't work because I am instead using Eval(byPara).
// Example Parameters
colParaList = {Column(dt, "Para1"), Column(dt, "Para2"), Column(dt, "Para3")};
splitPara = Column(dt, "Site");
byPara = Column(dt, "WaferID");
byParaValues = Associative Array(byPara) << GetKeys();
New Window("Test", vlb = V List Box(
dt << Fit Group(
For(iC = 1, iC <= NItems(colParaList), iC++,
Oneway(Y(Eval(colParaList[iC])), X(splitPara)) ),
<< {Arrange in Rows(1)},
Where(Eval(byPara) == "001"),
SendToReport( Dispatch( {}, "Fit Group" || Char(Eval(byPara) << GetName()) || "=" || Char(byParaValues[1]), OutlineBox, {Close( 1 )} ) ) )
)
);
Why does one of the two work, but the other doesn*t? In my expierience it also doesn't work if I replace "Eval(byPara)" by "byPara".
My goal is to write it similarly to the second version because the script cannot assume what the 'byPara' is going to be, so it should be general. Is there a way to achieve something like this?