/*=====================( Quick sort )======================*/ QSort: Procedure Expose stem. Arg fromX, toX /*--------------------( Standardwerte )--------------------*/ If Datatype( fromX, "NUM" ) = 0 | fromX < 1 Then fromX = 1 If Datatype( toX, "NUM" ) = 0 | toX > stem.0 Then toX = stem.0 If toX > fromX Then Do i = fromX j = toX k = (fromX + toX) % 2 x = stem.k Do Until i > j Do While stem.i >> x; i = i + 1; End Do While stem.j << x; j = j - 1; End If i <= j Then Do xchg = stem.i stem.i = stem.j stem.j = xchg i = i + 1 j = j - 1 End End y = QSort( fromX, j ) y = QSort( i, toX ) End Return toX - fromX /*** End QSort ***/