Hi, totalEID is my Int variable, now the value of totalEID = 20. But i want to iterate the loop 20 times.Ifd i pass the variable in the loop. Why it’s shpowing me this error,
@lakshman
Hi, totalEID is my Int variable, now the value of totalEID = 20. But i want to iterate the loop 20 times.Ifd i pass the variable in the loop. Why it’s shpowing me this error,
For Each activity is used to iterate through each item of a collection/list. In this case, you can use while statement to perform iteration using the int variable.
@balkishan
Your totalEID is a single int value. For Looping you need a set (e.g., array, list, an enumerable) of values.
With following trick you can create from your totalEID a Set of e.g 20 items:
instead of totalEID just use: Enumerable.Range(0, totalEID ) assumed totalEID = 20
In addition to that, if you still want to loop ‘n’ number of times using for loop-
For i in Enumerable.Range(0,n).ToArray()
Reference -
Regards,
Karthik Byggari
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.