[4.41] Bug in ArraySort (solved)
Posted: Thu Mar 18, 2010 8:46 pm
I found a very annoying Bug in PB4.41 as i used the SortArray-Function.
It allways add a Zero Entry and loose the highest one.
Example:
Mike
It allways add a Zero Entry and loose the highest one.
Example:
Code: Select all
;PB 4.41-Bug
RandomSeed( ElapsedMilliseconds() )
#ITEMS=6
;Fill Array With Random Values:
Dim idx.i(#ITEMS)
For i = 1 To #ITEMS
idx(i-1) = i*10; Random(10000)
Next
Debug "Before Sorting:"
Debug "---------------"
;Print Result
For i = 0 To #ITEMS-1
Debug( Str( idx(i) ) )
Next
;Sort
SortArray(idx(),#PB_Sort_Ascending)
Debug "After Sorting:"
Debug "---------------"
;Print Result
For i = 0 To #ITEMS-1
Debug( Str( idx(i) ) )
Next
;With Sort we loose the highest number, and get a zero as lowest
;Also if ther are no zero value in the array.