How Can I by VBA access the 2-dimension array defined local in a project ?

How Can I by VBA access the 2-dimension array defined local in a project (This 2-Dimension Array not defined inside VBA)? I tried "LocalArray.Index(i,j)" and complied OK but run failed. Meanwhile, for 1 Dimension Array, the "LocalArray.Index(i)" compiled OK and run good.

Please help me. Thanks a lot!  Please see my screen capture here:

Parents
  • Yes you are right. I think it is a CiVBA limitation. Event for 1 dimension Local type array, I can access the 1 dimension local array by a reference format like   "Report17.Index(5)" where inside the Index() should be a number directly, can not be a variable. So it need a long code to access the full array since loop can not be used. 

    When compiling there is no error or even warning for code like lines below, and when running it just does not work without any message. I hope there will be compile error/warning for these types of lines, and more detailed explanation inside the online manual for this LOCAL VARIABLE definition and use. 

    LocalArray.Index(0,0)=12345 ' does not work

    ArrayDataReceivedVBA(0,0)=LocalArray.Index(0,0) 'does not work 

Reply
  • Yes you are right. I think it is a CiVBA limitation. Event for 1 dimension Local type array, I can access the 1 dimension local array by a reference format like   "Report17.Index(5)" where inside the Index() should be a number directly, can not be a variable. So it need a long code to access the full array since loop can not be used. 

    When compiling there is no error or even warning for code like lines below, and when running it just does not work without any message. I hope there will be compile error/warning for these types of lines, and more detailed explanation inside the online manual for this LOCAL VARIABLE definition and use. 

    LocalArray.Index(0,0)=12345 ' does not work

    ArrayDataReceivedVBA(0,0)=LocalArray.Index(0,0) 'does not work 

Children