question

Thomas JR avatar image
0 Likes"
Thomas JR asked Ben Wilson commented

Error after updating FlexSim

I've just updated from 20.1.3 to the newest version.

At some point in my model I need to access a 2D array.

I simply use bracket syntax, MyArray[row][col] but FlexSim throws this error:

FlexScript exception: Invalid variant type used with [] array operator

It used to work just fine.

Specifically I use two labels of a 3D object as the indices of the 2D-array. Something like this:

  1. int duration = Durations[room.Day][room.Booking_number];

where the labels "Day" and "Booking_number" were created as:

  1. room.Day = 1;
  2. room.Booking_number = 1;

I tried to convert the labels to variant:

  1. Variant row = room.Day;
  2. Variant col = room.Booking_number;
  3. int duration = Durations[room.Day][room.Booking_number];

but without any success.

FlexSim 20.2.3
flexsim 20.2.3array
· 5
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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

I have gone through this again. I don't get any errors.

I have build a model in 20.1.2 and let it run in 20.2.3. I don't still see any errors.multidim_array_20_1.fsm


5 |100000

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