Output Array as Argument in InvokeCode Activity

I have declared an output argument in an InvokeCode activity as “OutputInt” with type “System.Int32” But I cannot reference that array in the vb.net code without throwing an error. Like this…

Dim i As Integer
For i = 1 To Limit
OutputInt(i) = i
Next i

Limit is a simple input argument with type Int32. That works fine.

I’ve tried putting reDim OutputInt(50) and Dim OutputInt(50) into the code, but that doesn’t work (already declared or reDim not allowed.

Thanks in advance for your help.

@DaBOT I guess you can try with List(Of Int32) , Since arrays need to be assigned with Size, it might throw an error in your case, Since you’re directly assigning values to the Array.

1 Like

Thanks for the suggestion, but it didn’t work. My workaround is to 1) declare and initialize a second array variable in the general workflow, 2) change the InvokeCode array declaration to an In/Out argument, and 3) set the Value of the In/Out array argument to the general workflow array. I can tell that the InvokeCode is changing values in the array which is what I want.