Uipath invoke code activity

Hi all, Good afternoon.
I am using invoke code activity in UiPath. How to get the array length in vb. Net code.

I have used array name. Length but it won’t worked.

@BHUVAN

array.count should do I guess

cheers

@BHUVAN
try with UBound(array)

1 Like

image

Length is correct. What is the error you are getting?

Dim numbers() As Integer = {1, 2, 3, 4, 5}
Console.WriteLine("The length of the array is: " & numbers.Length)

image

1 Like

I tried this but I am getting this error

Hi @BHUVAN

Try this:

Dim myArray As Integer() = {1, 2, 3, 4, 5} ' Example array, replace it with your array
Dim arrayLength As Integer = myArray.Length
Console.WriteLine("Length of the array is: " & arrayLength.ToString())

Check the below image and Output for better understanding:


image

Hope it helps!!

@BHUVAN
Instead of UBound(array1) give array1.Length

1 Like

@mkankatala thanks for helping me. :dizzy:

1 Like

It’s my pleasure @BHUVAN

Happy Automation!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.