Hi I have written a program which generates parameter index for 2 variables. Say, a and b in steps of 5. like this I have to do for 23 variables. So I don't want to write 23 for-loops to run, how can I make it into a single for-loop which is common for all 23 variables. I hope it can be done with an array, but i don't know how to implement it via program. Could you please help me?
Program:
int z, p
float a, b
float a0, an, s, a1, b0, bn, b1
str var
s=5; a0=1; an=10; b0=8; bn=13 // s= steps, a0, b0= initial value, an,bn=final value
z=0
a1=(an-a0)/s
b1=(bn-b0)/s
for (a=(a1+a0);a<=an;a=a+a1)
for (b=(b1+b0);b<=bn;b=b+b1)
echo {z} {a} {b} -format "%25s" >> /home/genesis/genesis-2.3/genesis/Scripts/kinetikit/dhanu19.txt
z=z+1
end
end
output : dhanu19.txt
0 2.8 9
1 2.8 10
2 2.8 11
3 2.8 12
4 2.8 13
5 4.6 9
6 4.6 10
7 4.6 11
8 4.6 12
9 4.6 13
10 6.4 9
11 6.4 10
12 6.4 11
13 6.4 12
14 6.4 13
15 8.2 9
16 8.2 10
17 8.2 11
18 8.2 12
19 8.2 13
20 10 9
21 10 10
22 10 11
23 10 12
24 10 13