Currently (FlexSim 17.0 & 17.1), Table class has a index operator which allows to get rows by name, but it fails with an uncatchable exception if a row with such header does not exist.
This syntax is nice:
Table tbl = somenode; return tbl["somerow"][column_name_or_number]; // OK
But there is a problem. Table class doesn't provide any method to check if there is a row with a given name in the table, and there is no way to handle exceptions in FlexScript.
This code throws an exception:
Table tbl = somenode; return tbl["nonexistent_row"][column_name_or_number];
The only workaround to avoid exceptions is to explicitly iterate over all Table rows, and do not use the index access at all. In the long term, an exception handling mechanism in FlexSim would help.
Could you please return a nullvar if the row (or column) doesn't exist? And/or add a way to check if there is a row or column with a given name?