question

Shinya O avatar image
0 Likes"
Shinya O asked Shinya O commented

datatype of global table

Hi,

I would like to use addRow and addCol methods of Table class but I do not know about datatype.

In the attached model, I am trying to confirm the correspondence between numbers and datatypes but I did not get the expectes output.

Is there any correspondence table?

1693372377690.png

Datatype_of_GlobalTable.fsm

Thanks in advance.

FlexSim 23.0.8
tabledatatypetable datatype
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Shinya O commented

You can check the defines to correlate types to numbers.

1693375767571.png

In regards to the "particle" type I found the following in the 19.0 documentation. It seems to have been outdated by quite some time.

1693375812547.png


1693375767571.png (10.8 KiB)
1693375812547.png (6.5 KiB)
· 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.

Arun Kr avatar image Arun Kr commented ·
1 Like 1 ·
Shinya O avatar image Shinya O commented ·

Thank you for your reply.

In the 5th line of the script, I use the addRow method to add a row by specifying the datatype from 1 to 7, but when I output it to the output console in the 8th line of the script, the values are 1, 2, 3, 4, 0, 6, 7 which is strange.


Numberdata, Stringdata, Pointerdata, Arraydata, FlexScriptdata, Bundledata and TrackedVariabledata were assigned to the 1st to 7th rows of the global table using the operations shown below, but the output console shows 1, 2, 3, 7, 2, 6, 7. The same number appears and I don't get the point.

1693376675698.png


What I ultimately want to know is the second argument of the addRow method when I want to assign Numberdata, Stringdata, Pointerdata, Arraydata, FlexScriptdata, Bundledata and TrackedVariabledata.


I think the data type of the second argument of the addRow method and the data type of treenode are slightly different.

(https://docs.flexsim.com/en/23.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/treenode.html#Property-dataType)

0 Likes 0 ·
1693376675698.png (36.4 KiB)
Felix Möhlmann avatar image Felix Möhlmann Shinya O commented ·

A Flexscript node still just contains text data, so its data type is string. The difference is what happens when the node is accessed which is controlled by whether or not the node is toggled and build as Flexscript.

For how you can do that by code, see the respective commands below.

1693378255447.png

Similarly, there is no dedicated data type for arrays or tracked variables which both use the simple type. For the tracked variables, you would first initialize the variable and then assign it to the table cell.

And as mentioned, the particle type is deprecated and not supported anymore. Hence the fifth added row has not been assigned a (valid) data type.

0 Likes 0 ·
1693378255447.png (14.7 KiB)
Shinya O avatar image Shinya O Felix Möhlmann commented ·

Thank you for your information.

I have realized that Array(), TrackedVariable.init(), and node toggles are necessary when assigning Arrays, Tracked Variables, and FlexScripts to table cells.

0 Likes 0 ·