I want to initialize an array and store data, but I don’t wanna specify the length. I thought dynamic array existed, but why am I getting an error: Index was outside the bounds of the array?
I have out argument out_myArray of type string. I then used Assign activity.
Assign: out_myArray = new string(){} /* Making it dynamic */ Assign: out_myArray(0) = “Test1”
this second line already gives an error! I am so confused. If I change the first line to:
Assign: out_myArray = new string(5){} /* Just assigned any length */
this works! Why do I have to specify the length for array declaration? I am so at a loss.
Hello,
I am not sure if you can achieve what you described. But you can resize the array by using ReDim and if you want to preserve the data in the array while resizing use ReDim Preserve.
Use Invoke code activity to execute the ReDim statement and assign output back to your original array. DynamicArray.xaml (4.8 KB)