Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
17%
200 - 500 GB
30%
500 - 800 GB
3%
800 - 1200 GB
7%
1200 - 1500 GB
10%
1500 - 2000 GB
13%
> 2000 GB
20%
Total votes: 30

Baanboard at LinkedIn


Reference Content

 
qss.sort()
By patvdv at 26 Feb 2008 - 21:57


qss.sort()

Syntax

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

Description

This function performs a fast sort a specified array.

Arguments

array

The name of the array to be sorted.

def

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:

    def(3,4)

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

    qss.start(def,3,0)

dept

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

Context

Bshell function.

Related topics

0
No votes yet


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


©2001-2018 - Baanboard.com - Baanforums.com