Creating a Function with String Array Parameter via Invoke VB.Net

Hello all,

I want to create a function with string array parameters. How can i do that ?

Like this => … Function(ByVal strArray As Array(new String) or ByVal strArray As StringArray)

I could not create string array in parameters so can anyone help me how is it possible?

Thanks.

HI,

Do you mean you need to pass strArray to InvokeCode or need to define function inside InvokeCode?

If former, the following might help you.


.
Regards,

Hi @Kuki_Force ,

What is it that you are trying to achieve here?
We usually Invoke a VB.Net script from start to finish, i.e., without having to create any functions.
If you want to access an Array of string, you can do so by passing it in the args under ** Edit Arguments** like so:


image

Kind Regards,
Ashwin A.K

hi, @ashwin.ashok and @Yoichi

This function is going to be a dynamic and yes @Yoichi it is going to be inside of the invoke code.
I have more than one String_Array with invoke parameters and these parameters are filled up with some different datas. I have select case and some cases are doing same jobs but for different arrays which i’ve already define in argument. I hope i make myself clear.

Ex: Lets say, we call the function c_Names
and when i use in the cases, it is going to be like this=>for case 5 c_Names(invoke_argument_1,index,etc)
for case 8=> c_Names(invoke_Argument_2,index,etc)
NOT : The number of invoke argument does not matter. these are different argument name.

If you need more info i can explain.

Thanks.

Hi,

I didn’t understand your requirement 100%, however, how about to use Dictionary<string,string[]>?

For example, let’s define the following dictionary, then pass it to InvokeCode

dict = New Dictionary(Of String, String())From{{"5",{"A","B","C"}},{"8",{"D","E"}}}

Then

dict("5") returns {"A","B","C"}

and

dict("8") returns {"D","E"}

Regards,