question

Jarek O avatar image
0 Likes"
Jarek O asked Arun Kr edited

Global variable Array with Array elements

Hi,

I would like to make an Global Variable with type Array, containing Arrays as elements.

example:

Array[2]: Array("foo",1), Array("foo",2);

It doesn't seem to be that easy for me.

Flexsim version: 17.1.6

Choose One
global variables
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

Arun Kr avatar image
0 Likes"
Arun Kr answered Arun Kr edited

Hi @Jarek O,

Here's a simple example.

First you create a global array variable manually, then you can insert array elements through code.

  1. int rows = 5;
  2. Array DataArray = [5,3,2];
  3. Array array = Array(rows);
  4. array.fill(DataArray);
  5. GlobalArray = array;// GlobalArray is the global array variable

Regards,

Arun KR

· 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.