Hi Christoph,
We have a XFunction "wxt" to extract data from worksheet to new worksheet, or highlight result rows, or add a new column with 0/1 as mark, e.g.
//extract rows that not contain 0 in column 1 and column 2 to a new worksheet
wxt test:="col(1) != 0 AND col(2) != 0" ow:=<new>
//highlight rows that not contain 0 in column 1 and column 2
wxt test:="col(1) != 0 AND col(2) != 0" sel:=1
// put on/off result to column 3 with condition values in column 1 and column 2 all are not 0
wxt test:="col(1) != 0 AND col(2) != 0" val:=3
Or you can use Origin C code. Please refer to following wiki page for detail examples on Worksheet::Extract function:
http://ocwiki.originlab.com/index.php?title=OriginC:Extract_Data_from_Worksheet
Look at strCondition, just change this variable to "col(1)!=0 && col(2)!=0" for your data.
Or use the following codes to generate condition to check value!=0 for all columns:
string strCondition;
foreach(Column col in wks.Columns)
{
string str;
str.Format("col(%d) != 0", col.GetIndex()+1);
if( strCondition.IsEmpty() )
strCondition = str;
else
strCondition += " && " + str;
}
Iris