question

Marian Cretu avatar image
0 Likes"
Marian Cretu asked Ben Wilson commented

Clear a specific cell

Hello guys,

Is it possible to clear a single table cell (without clearing the entire table) ? table[1][1] for example.

I want to clear it - not to make it equal to something. Just clear and set the cell type to number int.


Thank you.

FlexSim 20.2.2
flexsim 20.2.2table
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @marian.c2, was cliff.king's answer helpful? If so, please click the red "Accept" button on their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Cliff King avatar image
0 Likes"
Cliff King answered

There is not a picklist option in the global table's On Reset trigger field to clear a single table cell, but you can use the Code Snippet option to write your own statement of course.

Your statement will look something like this if written in the table's own On Reset trigger because the table is the "current" object: current[5][3] = 0;

When writing the code elsewhere, you need to use the Table constructor like this Table("myTable")[2][1] = 0;

Here's more information about Tables:

https://docs.flexsim.com/en/20.2/Reference/Tools/GlobalTables/#types

Here's more information about the Table constructor:

https://docs.flexsim.com/en/20.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html#Method-cell


5 |100000

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