Assignment Involving Static Array Variables

It is not possible to assign a value directly to (or from) a static array variable, and VTS's automatic index padding ensures that this does not happen. If it ever appears that a static array is participating in an assignment, automatic index padding works to make sure that only an element of the array is involved. The following code demonstrates the automatic index padding at work, with equivalent assignments in comments.

[

  AStaticArray[3] = 1;  

  BStaticArray[5][10] = 2;  

 

  SimpleVar;  

]

 

Init [

  If 1 Main;  

  [  

    SimpleVar = AStaticArray; { SimpleVar = AStaticArray[0] }  

    SimpleVar = BStaticArray[4]; { SimpleVar = BStaticArray[4][0] }  

    SimpleVar = BStaticArray[3][1]; { SimpleVar = BStaticArray[3][1]     }  

    SimpleVar = &AStaticArray; { SimpleVar = &AStaticArray }  

    AStaticArray = "super"; { AStaticArray[0] = "super" }  

    BStaticArray[4] = 3; { BStaticArray[4][0] = 3 }  

    BStaticArray[3][1] = 4; { BStaticArray[3][1] = 4 }  

    &AStaticArray = 0x00008000; { Error! Not an lvalue }  

    AStaticArray = BStaticArray;

    {AStaticArray[0] =  BStaticArray[0][0] }  

  ]  

]