question

Enrique Elizaga avatar image
0 Likes"
Enrique Elizaga asked Manuel Sinco commented

create a Global Table in flexscript

Is it possible to create new tables inside part of a code. Then to destroy in another code. The number of tables created will depend on an integer in a label called "DAYS TO RUN". I want to have data per day on each table. I tried insertcopy but didn't work.

FlexSim 18.2.2
global tableflexscript
5 |100000

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

Steven Hamoen avatar image
1 Like"
Steven Hamoen answered Manuel Sinco commented

@Enrique Elizaga If I want to do something like this I look through the tree to find how FlexSim did it. In this case there is actually an application command for it:

  1. treenode table = applicationcommand("addglobaltable");
· 3
5 |100000

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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Enrique Elizaga commented

Try this

  1. treenode globalTablesNode = model().find("Tools/GlobalTables");
  2. treenode newTable = createcopy(globalTablesNode.first,globalTablesNode,0);
  3. newTable.name = "myNewTable";

It copies the first global table of the global tables.

If you know the name of the table for example "MyKnownTableName"

  1. globalTablesNode.subnodes["MyKnownTableName"]

is the reference to this table object.

· 4
5 |100000

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