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:

  • Can you access elements of the array within Cicode or on a page display? If you can, and it does not work in CiVBA, it is likely a limitation.

  • 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 

  • I agree. Very likely a limitation of the CiVBA. Unfortunately the CiVBA is using a 3rd party library and compiler (which is no longer supported) so it will not be possible to enhance or improve the compiler. I'd definitely recommend look at using either Cicode or .NET (via Cicode) to find a solution.