Dim z , y As Double
Dim x() As Double
x=Array As Double(102,61,87.5,111.6,54,43,236.3)
Dim MyOrigList,MySortList As List
MyOrigList.Initialize
MyOrigList.AddAll(x)
MySortList.Initialize
MySortList.AddAll(x)
MySortList.Sort(True)
y= MySortList.Get(0) 'get the smallest
z=MySortList.Get(MySortList.Size-1) 'get the largest
Msgbox("Min: " & y & CRLF & "Max: " & z,"Min and max")
Dim idxMin, idxMax As Int
idxMin=MyOrigList.IndexOf(y)
idxMax=MyOrigList.IndexOf(z)
Msgbox("idx of Min: " & idxMin & CRLF & "idx of Max: " & idxMax,"Index of Min and max")