Discussion:
Variable with counter
(too old to reply)
Jörg Buchholz
2020-01-14 13:16:51 UTC
Permalink
Hello,

is it possible to create variables with a counter, like A1, A2, A3 and
so on?

What I want do do is the following:

do for [i=1:4]{
stats 'test.csv' every ::3:i:7:i u 6 nooutput
print STATS_min
}

This print the min value from block 1 - 4 to the display. But I want to
have it at 4 different variables, like B1, B2, B3, B4.

Jörg
Karl Ratzsch
2020-01-14 18:28:25 UTC
Permalink
Something like "help arrays" ?
Post by Jörg Buchholz
Hello,
is it possible to create variables with a counter, like A1, A2, A3 and
so on?
do for [i=1:4]{
stats 'test.csv' every ::3:i:7:i u 6 nooutput
print STATS_min
}
This print the min value from block 1 - 4 to the display. But I want to
have it at 4 different variables, like B1, B2, B3, B4.
Jörg Buchholz
2020-01-15 07:20:10 UTC
Permalink
Post by Karl Ratzsch
Something like "help arrays" ?
Thanks for the hint.

array B[4]
do for [i=1:4]{
stats 'test.csv' every ::3:i:7:i u 6 nooutput
B[i] = STATS_min
}

This works.

Jörg
Post by Karl Ratzsch
Post by Jörg Buchholz
Hello,
is it possible to create variables with a counter, like A1, A2, A3 and
so on?
do for [i=1:4]{
stats 'test.csv' every ::3:i:7:i u 6 nooutput
print STATS_min
}
This print the min value from block 1 - 4 to the display. But I want to
have it at 4 different variables, like B1, B2, B3, B4.
Loading...