當公式包含缺少的列時,我會發現錯誤。 在以下示例中,一個表包含 2 列。 添加一個使用不存在的列的新列,結果是缺少結果(正確),並且由於 try 語句不起作用而阻止我的腳本的錯誤。 有解決方法嗎?
dt= New Table( "Test",
Add Rows( 1 ),
New Column( "A",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2] )
),
New Column( "B",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values( [1] )
)
);
formula=":Name(\!"C\!") - :Name(\!"B\!")";
try(
eval(parse("dt << new column(\!"value\!", Numeric, \!"Continuous\!", Formula(" ||formula || "))"));
,
error="missing column";
);