The ExtremesArray, HighestArray a LowestArray functions are ignoring values stored in the field with index = 0. Is it a known bug?
Code: Select all
Inputs: ndays ( NumericSimple ) ;
Variables: ind ( 0 ) , var0 ( false ) , var1 ( false ), prevH ( 0 ), prevL ( 0 ) , DH ( 0 ), DL ( 0 ) ;
Arrays:
HA[ ] ( 0 ),
LA[ ] ( 0 );
if ndays > 1 then begin
var0 = array_setmaxindex ( HA , ndays - 1 ) ;
var1 = array_setmaxindex ( LA , ndays - 1) ;
for ind = 0 to ndays - 1 begin
HA [ ind ] = HighD ( ind + 1 );
LA [ ind ] = LowD ( ind + 1 ) ;
end;
{prevH = highestarray ( HA , ndays - 1 ) ;
prevL = lowestarray ( LA , ndays - 1 ) ; }
value1 = ExtremesArray ( HA, ndays-1 , 1 , prevH , value2 ) ;
value3 = ExtremesArray ( LA, ndays-1 , -1 , prevL , value2 ) ;
print ( " ................ " ) ;
print ( date:10:0 , prevH:10:2 , prevL:10:2 ) ;
print ( " ................ " ) ;
end;
for ind = 0 to ndays - 1 begin
print ( (ind ):6:0 , HA[ind]:10:2 , LA[ind]:10:2) ;
end;
end;