MinMaxArray




Function ValoreMassimo(Valori_Ary as variant) as long
Dim Confronto as long
Dim Vr_Max as long
Dim a as integer
if isarray(Valori_Ary) then
if UBound(Valore_Ary) = -1 then
Vr_Max = Null
else
Vr_Max = Valori_Ary(UBound(Valori_Ary))
for a = LBound(Valori_Ary) to UBound(Valori_Ary)
Confronto Valori_Ary(a)
if Confronto > Vr_Max Then '* Vedi nota in fondo
Vr_Max = Confronto
end if
next a
end if
ValoreMassimo = Vr_Max
else
ValoreMassimo =Null
end if
End Function

'Sostituendo l'operatore di confronto nell'interazione

'centrale della funzione sopradescritta e possibile

'calcolare il valore minimo.

If Confronto < Vr_Min then
Vr_Min = Confronto
End If










( minmaxarray.html )- by Paolo Puglisi - Modifica del 17/12/2023