To see the table created by Flex Script

To see the table created by Flex Script

ABajpaiWMKNX
Participant Participant
11 Views
9 Replies
Message 1 of 10

To see the table created by Flex Script

ABajpaiWMKNX
Participant
Participant

[ FlexSim 23.0.8 ]

How do I get to see a table generated by the code written in Flex Script to see what it looks like?

Circled is the code that creates the table called "result". I want to print it in the output console to see its content for debugging purposes.

Champion Homes Assembly Making Replica (2)_3.fsmscreenshot-2023-05-30-115035.png

0 Likes
Accepted solutions (1)
12 Views
9 Replies
Replies (9)
Message 2 of 10

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

The easiest way is to create a temporary global table and clone the result to it.

result.cloneTo(Table("temp"))


Message 3 of 10

ABajpaiWMKNX
Participant
Participant
Thank man! That worked!
Message 4 of 10

ABajpaiWMKNX
Participant
Participant
Jason. I noticed that after the "temp" table was deleted by me, it did not create it again. Do we know why this happens? Is it because the code you wrote in "writeStationMaps" custom code does not run?
0 Likes
Message 5 of 10

jason_lightfootVL7B4
Autodesk
Autodesk
Deleted or cleared? It needs the table to exist to write to it. If it exists and you added the line to clone then it will write to it. Did you apply the code before closing the user command gui?
0 Likes
Message 6 of 10

ABajpaiWMKNX
Participant
Participant

I deleted it. So i added the table back with the name "Temp" and ran the code again. For some reason, it does not clone the data in the Temp table.


Champion Homes V1.fsm

0 Likes
Message 7 of 10

jason_lightfootVL7B4
Autodesk
Autodesk
It's case sensitive so needs to match the case in the code... (I had lower case in my example)
0 Likes
Message 8 of 10

ABajpaiWMKNX
Participant
Participant

So is mine. I change the name of global table to "temp" as well. But it won't clone the queried table from PTimeByPart to temp.


On top of that, whenever i debug it, it will not go to the line number 9 where i am asking it to clone the table. the yellow arrow does not show next to line 9 even though i keep clicking 'Next Line'.


1685482141562.png


0 Likes
Message 9 of 10

jason_lightfootVL7B4
Autodesk
Autodesk

You use 'StationID' in your new command's sql but the table has 'stationID' - again, everything is case sensitive.#

You'll notice also that the value in the stationID field needs to match that of the label on the station. Currently the table has 'STATION 1' while the label on the station is 'Station 1' so no records will be returned even with the field name changes.

The command I sent worked - are you trying to recreate it just for understanding? You can use the debugger to inspect local variables as the code executes and you can also use it to spot which lines cause the execution to 'bomb-out' and throw and exception.

Message 10 of 10

ABajpaiWMKNX
Participant
Participant
JESUS! That worked! I was scratching my head for 2 hours! You're awesome! Thanks!
0 Likes