>Huh? for just finding the minimum, stepping once through the store is the fastest option, differences come from implementation details like language. And as the time to sort big arrays increases more than the stepping approach, unless afterwards an operation on sorted items is needed, asort() feels like a bad idea unless used for a particular spot, but not as a common way to resolve the question.
Implementation detail: ASORT is C code. A do while loop is Fox higher level pseudo compiled code. Wouldn't asort be fastest until the list had thousands of entries? Just curious
>
>
>
>>For your ARRAY, whats wrong with ASORT() ?
>>>
>>>That begs the question what are you doing that for? To go through a list of items of any length and grab the minimum and then have a pointer to the item is a piece of cake.
>>>
>>>If you have an array with values
>>>
>>>
DIMENSION laList[2]
>>>laList[1]=10
>>>laList[2]=20
>>>lnMin=laList[1]
>>>lnPointer=1
>>>FOR X=2 TO ALEN(laList,1)
>>> if laList[m.x] < lnMin
>>> lnMin = laList[m.x]
>>> lnPointer = m.x
>>> endif
>>>ENDFOR
>>>
>>>?"the row with the minimum value is ",m.lnPointer
>>>
>>>With a cursor
>>>
>>>
calculate mix(field) to m.lnMin
>>>locate for field=m.lnMin
>>>lnPointer=recno()