question

Ruan H avatar image
0 Likes"
Ruan H asked Ben Wilson commented

Difference between gettablenum and Table() [] []

error.png

i assumed 1&2 have the same meaning, also 3&4.

but in flexsim v2019, 3&4 reported error, but 1&2 are perfectly ok. details showed in foto.

pls, anyone can help me understand the differences, if there are, thanks a lot.

1 int chess_type = gettablenum("ChessInfo" ,row,col);

2 int chess_type = Table("ChessInfo")[row][col]

3 string chess_name =gettablenum("Chess_type " ,chess_type ,2);

4 string chess_name = Table("Chess_type ")[Chess_type ][2]

FlexSim 19.0.0
tablesgettablenum
error.png (129.8 KiB)
· 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.

1 Answer

Ben Wilson avatar image
1 Like"
Ben Wilson answered Ben Wilson commented

Hi @Ruan H ,

FlexSim version 19.0 supports all the styles of syntax you're using. Here is a model I just used to test (tableCheck.fsm):

1634058806430.pngYour errors must be occurring in some other aspect of your code. Check your syntax. Check your variable values. Use the debugger to step through your code if you need to.

Good luck!


1634058806430.png (39.1 KiB)
tablecheck.fsm (16.1 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.