I'm needing to put limits into a data column from a separate table. That table has a "0" if that particular limit is not set. This script works fine for loading the limits if there are no limits, or if it has both limits, but I have been unable to get it to work when there is just one limit. It puts both in leaving the second limit set at "0".
//set limits
If( db_Tests:MinLimit[TestRow[1]] != 0 | db_Tests:MaxLimit[TestRow[1]] != 0,
Eval(
Substitute(
Expr(
col << set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
),
Expr( _L ), db_Tests:MinLimit[TestRow[1]]
,
Expr( _U ), db_Tests:MaxLimit[TestRow[1]]
)
)
);I tried putting them in one at a time. If the LSL is not "0" update the LSL, then if USL is not "0" update that one. The problem with that is it overwrites the first one if they both have limits. In other words, that way works for every case except when both LSL and USL exist, but when they both exist it puts the first one in and then when it puts the second one in the first one is gone. I'd appreciate any help on this one. Thanks