I would like to loop through two lists using a For each loop.
dim data as list(of pointpairlist)
For each recLine in records
For Each chan In recLine.channels and d in data
d.add( func(chan) )
Next
next
note: each record line has one sample from each channel recorded. ie each record line is a slice of a 32 sensor recordings. I want to build up a x,y list of data points for each channel (the x axis is common to all channels)
Is there some way to do it similar to what i have above (avoiding indexing variables)
The best way to iterate over two different collections in a single loop is to use indexers.
As @0xA3 comments, you can also a while loop, calling
GetEnumerator,MoveNextandCurrentdirectly on each collection, but this buys you nothing.I realize you want to avoid using indexers, but there is no simple language support for anything else.
This is the case also for C#.
Why do you need to avoid indexers?