Can you loop two lists at once?

Good morning friends, a question please:
test_.zip (58.3 KB)

I am generating two lists from a condition, then I want to go through the lists so that the SUPPLY and PORTFOLIO data can be entered into a web.
In the console it should come out:

image

LIMACAR
LIMACAR_P
IDTERM
IDTERM_P
NANCE
NANCE_P
ATANI
ATANI_P

Hey,

if the 2 lists are of equal length, you can use this:

Best,
Charbel

2 Likes

Thanks for answering, but how does list 2 reference it? . Exactamente que es lo que hace Enumerable.Range(0,list1.Count) ?

If both lists have the same Count, then list1.Count should be the same as list2.Count

Hi @Lynx

Can you confirm that will there be equal number of counts in both lists

Regards
Robin

Yes, it will always be the same size

Hi @Lynx

Refer to this thread below

Regards
Gokul

I am looking for is that the first loop have the following data:
LIMACAR LIMACAR_P
In a second:
TERMID TERM_P

third:
NANCE NANCE_P

latest:
ATANI ATANI_P

Hi @Lynx

Then try out this

Count = yourlistvariable.Count-1

Where count variable is type of int32

Put a while loop and set condition as i <=Count

Inside that while loop

Use your list variable like this yourlistvariable1(i).Tostring Yourlistvariable2(i).ToString. (Where you want to use the two list variables)

Increment i in the termination of while loop
Ex i = i+1

Hope it solves your issue

Thanks
Robin

1 Like

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