[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About Highest_a function?



PureBytes Links

Trading Reference Links

Hi folks,

Highest_a returns the Highest value within an Array of values.
Does anyone understand the reason why there is an else statment when
Array_size is equal to 0 or a negative value?
In fact, I find strange that an array can have a negative number of
elements!
What do you think of this?

In reality, Array_size reprents the number of elements for which we want
to know the highest one.
Array_size can be inferior or equal to the number of elements that the Array
contains.




Here is the code below
************************************************************************}

Inputs: HighestArray[size](NumericArrayRef), Array_Size(Numeric);
Variables: HiHi(0);
{Array_Size is passed as an Input so that only the array elements that have
been used are referenced}

HiHi = HighestArray[1];

For value1 = 1 To Array_Size Begin
	If HighestArray[value1] > HiHi Then
		HiHi = HighestArray[value1];
End;

If Array_Size > 1 Then
	Highest_a = HiHi
Else
	Highest_a = HighestArray[Array_Size];






Many thanks for your help !
Rgds,

Philippe


°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
philippe.lhermie@xxxxxxx

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°