Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd November 2017, 12:37
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 129
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Can i sorting an array in BaaN using any predifined function...
Baan: Other/Unknown
C/S: None/Unknown

Hi,

I'm new for LN programming... I want to know that there is any predefined LN functions are available for sorting a one dimensional array in ascending or descending order. If it is possible one, please let me know....
Thanks in advance,
Regards,
Pralash
Reply With Quote
Sponsored Links
  #2  
Old 22nd November 2017, 13:22
srprks srprks is offline
Member
 
Join Date: May 2016
Location: Bangalore
Posts: 72
srprks is on a distinguished road
Baan: 10.4,Baan IV - DB: Oracle,SQL - OS: Unix,Windows
Quote:
Originally Posted by pralash View Post
Hi,

I'm new for LN programming... I want to know that there is any predefined LN functions are available for sorting a one dimensional array in ascending or descending order. If it is possible one, please let me know....
Thanks in advance,
Regards,
Pralash
Searching and sorting data overview and synopsis
Overview
Use these functions for searching and sorting data. Use qss.search() to search the data for a particular value. Use qss.sort() to sort the data. The data can be a string or an array of type string, long, or double.

The qss.search() function can perform either a linear or a binary search. A binary search is faster than a linear search, but the data must first be sorted by qss.sort(). In practice, therefore, a binary search is efficient only when the data does not often change and so does not require repeated sorting. If the data is frequently modified, use a linear search on unsorted data instead; this avoids frequent calls to qss.sort().

Synopsis
long
qss.search() ( long flag, void search, ref void array, ref long def [, long dept] )
long
qss.sort() ( ref void array, ref long def [, long dept] )
Reply With Quote
  #3  
Old 23rd November 2017, 08:56
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 129
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
I have an array such as count(10)... Every index has different integer values.... I want to sorting this array in ascending order... Can you please tell me the sample script for how to sort this array by using "qss.sort" function...
Thanks,
Regards,
Pralash
Reply With Quote
  #4  
Old 23rd November 2017, 10:05
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,653
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
qss.....

Hello,
Code:
qss.sort()
Syntax:

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

Description


This function performs a fast sort of a specified array.

Note that the order in the result array of two elements that compare identical is unpredictable.


Arguments

ref void array The name of the array to be sorted.
 
ref long 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)
 
long 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
Have you seen ?
http://www.baanboard.com/programmers_manual_baanerp
__________________
//Bernd

Last edited by bdittmar : 23rd November 2017 at 10:07. Reason: link added
Reply With Quote
  #5  
Old 23rd November 2017, 11:53
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 129
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Thanks for your information...
Will refer the URL as you suggested...
Regards,
Pralash
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
purpose of qss.start VishalMistry Tools Development 3 25th January 2017 19:20
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 12:35
Invitation to SSA Global's BaaN User Group Meeting in Bangkok nopadon ไทยฟอรัม 0 12th January 2005 20:25
Baan World Users conference in Orlando chadwickh General Discussion & Chat 7 3rd November 2001 22:55
BSP-US (LLC) added as a Baan Education Alliance svandenh General Discussion & Chat 1 20th August 2001 20:44


All times are GMT +2. The time now is 01:09.


©2001-2017 - Baanboard.com - Baanforums.com