question

Gesa R avatar image
0 Likes"
Gesa R asked Kari Payton commented

How to print or look up a local table in FlexScript in a ProcessFlow?

Hi,

I have a process flow in wich I use custom code. In the custom code I use a query to get specific data from two different global tables. Now I would like to check if the query is correct, e.g. print or view the new table "result". Where does this table "result" exist? I did not create a new global table for this.

  1. Table result=Table.query("SELECT * FROM Workers AS A, Machines AS B WHERE A.MachineNo=B.MachineNo AND B.MachineNo=1);

The command print(result); shows <no path>.

Thank you for helping.

@Mischa Spelt

FlexSim 18.0.3
process flowflexscripttablesnodesprint
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

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered Kari Payton commented

You can use the cloneTo method to copy the in-memory result table to an actual table in the model.

  1. result.cloneTo(Table("GlobalTable1"));

You can also use the clone method to copy the table into an array which could then be printed.

  1. print(result.clone());
· 1
5 |100000

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