Hello !
I have a big problem using arrays as global variables. Here it goes :
Formula 1 :
global numbervar array m1 := makearray({#MOYH CO 1 0},{#MOYH CO 1 1},{#MOYH CO 1 10},{#MOYH CO 1 11},{#MOYH CO 1 12},{#MOYH CO 1 13},{#MOYH CO 1 15},{#MOYH CO 1 16},{#MOYH CO 1 17},{#MOYH CO 1 18},{#MOYH CO 1 19},{#MOYH CO 1 2},{#MOYH CO 1 20},{#MOYH CO 1 21},{#MOYH CO 1 22},{#MOYH CO 1 23},{#MOYH CO 1 3},{#MOYH CO 1 4},{#MOYH CO 1 5},{#MOYH CO 1 6},{#MOYH CO 1 7},{#MOYH CO 1 8},{#MOYH CO 1 9},{#MOYH CO 1 14});
MAXIMUM(m1);
Formula 2 :
global numbervar array m1;
evaluateafter({@MOYH CO MAX 1}); //it's formula 1
local numbervar i;
local numbervar nb := 0;
for i := 1 to 31 step 1 do
(
if m1 > 100 then
(nb := nb + 1)
);
nb
I use CR 8.5 and I get this message (translated from french) : an index must be between 1 and the array length
I don't understand where & when this error occur
In formula 1 all 31 running totals are verified and are OK
in formula 1, i collect the 24 hourly averages of a day, and i take the maximum one
in formula 2, i need to count the number of averages that go over 100
Thanks by advance
I have a big problem using arrays as global variables. Here it goes :
Formula 1 :
global numbervar array m1 := makearray({#MOYH CO 1 0},{#MOYH CO 1 1},{#MOYH CO 1 10},{#MOYH CO 1 11},{#MOYH CO 1 12},{#MOYH CO 1 13},{#MOYH CO 1 15},{#MOYH CO 1 16},{#MOYH CO 1 17},{#MOYH CO 1 18},{#MOYH CO 1 19},{#MOYH CO 1 2},{#MOYH CO 1 20},{#MOYH CO 1 21},{#MOYH CO 1 22},{#MOYH CO 1 23},{#MOYH CO 1 3},{#MOYH CO 1 4},{#MOYH CO 1 5},{#MOYH CO 1 6},{#MOYH CO 1 7},{#MOYH CO 1 8},{#MOYH CO 1 9},{#MOYH CO 1 14});
MAXIMUM(m1);
Formula 2 :
global numbervar array m1;
evaluateafter({@MOYH CO MAX 1}); //it's formula 1
local numbervar i;
local numbervar nb := 0;
for i := 1 to 31 step 1 do
(
if m1 > 100 then
(nb := nb + 1)
);
nb
I use CR 8.5 and I get this message (translated from french) : an index must be between 1 and the array length
I don't understand where & when this error occur
In formula 1 all 31 running totals are verified and are OK
in formula 1, i collect the 24 hourly averages of a day, and i take the maximum one
in formula 2, i need to count the number of averages that go over 100
Thanks by advance