Design Scripting Documentation
     
 
     
  Array Bouble Sort (deprecated)  
     
     
  Inputs:  
     
an array of any kind
a comparison function by name as string
some optional user defined data (can be vbnull)
     
  Outputs:  
     
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
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File