AnswerHub Upload Issue
Our AnswerHub community currently has a bug that prevents you from attaching your model or other files to your questions. AnswerHub is aware of this issue and they are working on a fix. Until we receive their patch, you can upload your models and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

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.

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.

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

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

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.

Is is possible to assign a label to a token from a query without cloning to a table? For example I want to lookup a value in table 1 column A that matches the value in table 2 column A and write to a label a value from table 2 that is in column F. @Matthew Gillespie

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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