07-20-2018 06:59 AM
Hello
I want to repeatedly run a calculation over 2 channels of many groups, such as
ChnMapLinCalc("[i]/chan A","[i]/chan B,.... )"
and the like, which take 2 input channels
Now this could be done quite efficiently using lists, e.g.
Set oXList = data.getchannels("*/chan A")
Set oYList = data.getchannels("*/chan B")
and run
for each oXCh in oXlist
Set oYch = oYList( index of oCh in oXList )
Call ChnMapLinCalc(oXCh, oYCh)
next
However, I cannot find a way to retrieve which index in oXList my loop is at.
(Apart from some workarounds with loop variables like i=0: i=i+1. in which case I could just as well discard the ElementList- elegance.
OTOH, there must be some type of internal pointer to the list element.
Thank you for suggestions.
Michael
07-20-2018 07:59 AM
You can just loop by index instead of using for each
Option Explicit Dim oMyChns: Set oMyChns = Data.GetChannels("T*") dim i : for i = 1 to oMyChns.Count LogFileWrite(oMyChns(i).name) Next