question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Jason Lightfoot edited

Table header: check if header exists

Hi

Is it possible to check, if table has some specific column/row header name? Eg. check if table has row header "Products" (Table("MyTable")["Products"][1]). Something else than looping thru the whole table.



FlexSim 22.2.1
tables
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot edited
string colheader="Col 3";
treenode data=reftable("GlobalTable1");
if (data.dataType==DATATYPE_BUNDLE)
return getbundlefieldnr(data,colheader)>-1;
if (data.subnodes.length)
    return objectexists(data.first.subnodes[colheader]);
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.