| |
|
|
| |
Array Bouble Sort (deprecated) |
|
| |
|
|
an array of any kind a comparison function by name as string some optional user defined data (can be vbnull)
the same array sorted
| |
|
|
| |
Implementation
01 function array_sort( array_object, comparison_function, user_data )
02 dim i: i = array_length( array_object )
03 do while( i >= 0 )
04 i = i - 1
05 dim j: j = 0
06 do while( j < i )
07 dim a: a = array_object( j )
08 dim b: b = array_object( j + 1 )
09 if( eval( comparison_function + "( a, b, user_data )" ) > 0 ) then
10 array_object( j ) = b
11 array_object( j + 1 ) = a
12 end if
13 j = j + 1
14 loop
15 loop
16 end function
|
|
| |
|
|
|