Go Back

User login

Frontpage Sponsor


How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
200 - 500 GB
500 - 800 GB
800 - 1200 GB
1200 - 1500 GB
1500 - 2000 GB
> 2000 GB
Total votes: 58

Baanboard at LinkedIn

Reference Content

By patvdv at 26 Feb 2008 - 21:57



long qss.sort( ref void array, ref long def [, long dept] )


This function performs a fast sort a specified array.



The name of the array to be sorted.


This determines how the array is to be sorted. The argument must be declared as follows:

long def(x,4) | x is the number of sort fields

You can define several sort fields (1 to x). When performing a sort, the system sorts on the first sort field. Then, if there are duplicate values in the first sort field, the system sorts on the second sort field, and so on.

For each sort field, you define the four sort properties by using the following functions. In each case, the field_number argument specifies the sequence number (1 to x) of the sort field.

  • void qss.start( ref long def, long field_number, long position )

    This specifies the start position of the sort field in the array elements.

  • void qss.way( ref long def, long field_number, long way )

    This defines the sort order. The argument way can be set to QSS.UP (ascending sort) or QSS.DOWN (descending sort).

  • void qss.type( ref long def, long field_number, long type )

    This specifies the sort field's type, for example. DB.LONG, DB.DOUBLE, DB.STRING, DB.DATE, and so on.

  • void qss.length( ref long def, long search_condition, long length )

    This specifies the length of the sort field. This option is valid only when sorting strings.

    If you define fewer sort fields than you have declared, you must close the def argument by calling qss.start() with a start position of zero. For example, if you have declared three sort fields, as follows:


    but then create only two sort fields, you must close the definition with the following call:



This indicates the number of array elements to be sorted if the function is not intended to sort the entire array. By default, the function sorts the entire array.

Return values

0 success
-1 error
-11 def is not of type long array or array not of type array
-13 dept must be positive
-14 def argument not correctly declared
-16 QSS.TYPE not correct
-17 array argument not correct
-18 no definition found in def


Bshell function.

Related topics

No votes yet

All times are GMT +2. The time now is 12:20.

©2001-2018 - -