DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the list (vector) of selected channels from the portal

Hi,
 
I try to retrieve the selected channels from the portal to use them in my script. I use "DataCheckChnls". Is it possible to convert it to a vector, to use it after in in for next structure.
 
I would like to do specific calculus for each selected channel. Must I use another method ?
 
Thank's in advance.
0 Kudos
Message 1 of 5
(4,021 Views)
Hello!
 
Have a look at 'ChnStrToChnList'. This will do what you need.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 5
(4,020 Views)
Thank's for your reply,
 
With the 'ChnStrToChnList' function, it return the index but the format is '5-8,10', what is very 'difficult' to interpret.
 
In fact, I need to call my function with index for each channel (e.g. myFunction(indexChannel)).
 
If I am right, I need to do a script who interpret the '-' and ',' to construct my vector ('5-8,10' -> [5,6,7,8,10]). Is it exact ? Doesn't it exist this kind of function in DIAdem ?
 
Thanks.
0 Kudos
Message 3 of 5
(4,014 Views)
Hello!
 
Sorry, I trusted the DIAdem help and did not testetd it. But I'm not completly wrongSmiley Wink
What you get is an array of strings containing the channel name. In standard use these names are unique and could be transfered to a channel numbers with the CNo command. Try this code to understand this:
Option Explicit
 
Dim aoChannels
Dim oChannel
 
aoChannels = ChnStrToChnList(DataCheckChnls)
 
For Each oChannel In aoChannels
  MsgBox CNo(oChannel)
Next
If you realy need the numbers as array you can build a function to do this based on this code:
Option Explicit
 
Dim i
Dim aoChannels
Dim anChannels
 
aoChannels = ChnStrToChnList(DataCheckChnls)
ReDim anChannels(UBound(aoChannels))
 
For i=0 To UBound(aoChannels)
  anChannels = CNo(aoChannels(i))
Next
Matthias
 
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 5
(4,010 Views)

Matthias,

 

Thank's a lot, it works very well ! DIAdem is my friend !

Goodbye.

0 Kudos
Message 5 of 5
(4,006 Views)