04-23-2021 11:54 AM
I want to use the Group Names to determine which analysis type occurs in a script.
Ex: I have 4 types of Channel Groups that have multiple variations in my data portal
A1
A2
A3
B1
B2
B3
C1
C2
C3
C4
D1
D2
D3
A4
etc etc
I want a script that does something like:
for ii = 1 to numberGroups
if Group(ii)Name = "A*" then
analyze A
else if Group(ii)Name = "B*" then
analyze B
etc etc
Does anyone have any experience doing this?
04-27-2021 03:14 AM
Hello Brian,
for similar evaluations I use SelectCase; is easier for me and the code is more clear.
The calculations itself are "outsourced" into the subs, which can be placed at the end of the main code.
For iGr = 1 To Data.Root.ChannelGroups.Count
analyse = Left(Data.Root.ChannelGroups(iGr).Name)
Select Case analyse
Case "A"
Call AnalyseA
Case "B"
Call AnalyseB
End Select
Next
Sub AnalyseA
'.....
End Sub
Sub AnalyseB
'.....
End Sub