Newbie question about persistent data for arrays in between ticks

 

Hello, I am trying to create persistent set of data for an array, as a test, but it doesn't work. This is the code:


void OnTick(){

  int multi[][3];

  if (ArraySize(multi) == 0) {
    Print("Array size = 0");
    ArrayResize(multi,3);
    multi[0][0] = 1;
    multi[0][1] = 2;
    multi[0][2] = 3;
    multi[1][0] = 4;
    multi[1][1] = 5;
    multi[1][2] = 6;
    multi[2][0] = 7;
    multi[2][1] = 8;
    multi[2][2] = 9;    
  }
  else {
    Print("Array size != 0");
  }

}

But I always get the message "Array  size = 0". Could someone please clarify what I'm missing? Why isn't the data saved between ticks?

Thank you :)

 
If you want to keep data between ticks, declare the array globally.
Reason: