How loop depending on an array length

Hi all,

I have a question which is how could I loop according to the length of an array?

So for instance if myArray.Count = 2, then I would like the For Each to loop 2 times.

Regards

Use for each loop
sequence:
image

variable pannel :

output:
image

This loop will go till the end of the array

Reagrds,

@SRoyi

For Each item In myArray
// Your actions or activities to perform on ā€˜item’
// This block will be executed for each item in the array
End For Each

image

image
U can use this way
The Set of activities inside this for each loop will execute for each item in an array

@SRoyi

You can just give the array directly

Or use Enumerable.Range(0,arr.Count)

Cheers

image
Do you mean it like this? Currently the error message is Count is not a member of Interger

@SRoyi

Looks like countOFAWB is already a integer variable and not the count…if that is the count of array then just use Enumerable.Range(0,countOfAWB)

Cheers

Ahh okay, thanks for the help!

1 Like

Hey @SRoyi , you can also just give your array variable in ā€œInā€ field
That normally works

If that failed to work then give it has Enumerable.Range(0,countOfAWB)

Hope it helps you out

1 Like

Hi, there

Yes I have tried it and it didn’t work. So I proceeded with the second solution. Thanks for your insights any way :pray:

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