DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

To put it in a FOR loop

Dear anyone,

 

I have written a code which calculates averages for 26 different groups. Attached the sample code in .txt file for reference. I would like to put it in a FOR loop to avoid writing a lenghthier code to calculate averages for 26 different groups. Attached code contains average calculation for 2 groups.

Request you to help for the same.

 

Regards,

 

X. Ignatius

0 Kudos
Message 1 of 3
(4,489 Views)

Morning Ignatius,

 

Do you need to access numbered data like "myChannelName0", "myChannelName1", ... "myChannelNameN"; member of numbered groups?

In this case you may use the string function "Str()" like:

 

For i = 1 to N

  Dim currCannelName = baseChannelName + Str(i)

Next ' i - number of...

 

For groups you may use it like:

For j = 1 to M

  Dim currGroupByIndex = "[" + Str(i) + "]"

Next ' j

 

Then the given channel of the given group index can be like:

currChannelName = currGroupName + "/" + baseChannelName + Str(i).

 

Have I undertsand your question well?

 

Best regards

 

Gábor

0 Kudos
Message 2 of 3
(4,371 Views)

Hi,

 

Sorry, all with "Dim" was not correct, it shall look like this:

 

For i = 1 to N

  Dim currChannelName : currChannelname = baseChannelName + Str(i)

Next

 

(Consider the ":").

Sorry, I was too fast by typing

 

Regards

 

Gábor

0 Kudos
Message 3 of 3
(4,370 Views)