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 25th January 2017, 12:17
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 573
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face purpose of qss.start
Baan: Baan IVc4
C/S: Both

hello everyone,

I just came to know about qss.* series of functions.

Can anybody explain with a short example, what is the purpose of followig qss functions:

qss.start (this is not present even in baan manual)
qss.way
qss.type

thanks in advance,

Vishal
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2017, 12:24
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,
from DEV-Guide !
Code:
BaanERP Programmers Guide

Send feedback about the online Help to Baan Development 
qss.search()

--------------------------------------------------------------------------------

Syntax
long qss.search( long flag, void search, ref void tbl, ref long def [, long dept] )

Description
This searches a specified array for a particular value, which is referred to as the search key. By default, it reads the array sequentially until it finds the specified value (that is, it performs a linear search). To perform a binary search instead, you must first sort the data with qss.sort() and then call qss.search() with the flag argument set to QSS.SRC.IS.SORTED. 

Arguments
flag
 This specifies which array element is to be retrieved and the type of search to be performed. You can set the argument to one of the following possible values:

QSS.FIRST    Find the first record in the array; the search argument is ignored.
QSS.LAST      Find the last record in the array; the search argument is ignored.
QSS.GT          Find the first record greater than the search key.
QSS.GTEQ    Find the first record greater than or equal to the search key. 
QSS.LESS     Find the first record less than the search key.
QSS.EQLE     Find the first record less than or equal to the search key. 
QSS.EQUAL   Find the first record equal to the search key.
QSS.NE          Find the first record not equal to the search key.

You can combine each of these options with one or more of the following options:
 
 QSS.SRC.IS.SORTED
 Specifies a binary search. The array must previously have been sorted by using qss.sort().
 
 
 QSS.LOOKUP.FOR.STRUCT
 When this flag is set, the function searches the array for a specified record pattern – that is, it searches for an array element that matches both the structure and value of the search key. The search argument must have the same layout and length as the elements in tbl. 

When this flag is not set, the search argument is constructed as the concatenation of the key fields defined by the def argument (see Example 2).
 
 
 QSS.SRC.DUPL.ALLOWED
 Specifies that the search key can occur more than once in the source array.
 
search
 The value that you want to search for in the specified array. This is the search key.
 
tbl
 This specifies the array that must be searched. It can be a string or an array of type string, long, or double, but it is usually an array of strings.
 
def
 This indicates how the system is to search the array and against what conditions it must test the elements of the array.  The argument must be declared as follows:

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

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

void qss.start( ref long def, long field_number, long position ) 
This indicates the search field's start position in the array element. For example, this allows you to search a string array for a character combination starting at the fourth character of the array element.

void qss.way( ref long def, long field_number, long way ) 
This defines the search order that must be used if the flag QSS.SRC.IS.SORTED is set. The argument way can be set to QSS.UP (ascending search) or QSS.DOWN (descending search).

void qss.type( ref long def, long field_number, long type ) 
This specifies the search field's type – for example, DB.LONG, DB.DOUBLE, DB.STRING, DB.DATE, and so on.

void qss.length( ref long def, long field_number, long length ) 
This specifies the length of the search field. This option is valid only for strings. 

If you define fewer search 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 search fieldss, as follows:

def(3,4)

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

qss.start(def,3,0) 
 
dept
 This indicates the number of array elements (starting with the first element) that must be searched if the function is not intended to search the entire array. By default, the function searches the entire array until it finds the required value.
 

Return values
>0        index in the array where the search key was found
-1         error; search argument not found
-11       search argument must be of same type as array; 
            def is not of type long array or tbl not of type array
-12       search argument not correct; string not expected
-13       dept must be positive
-14       def argument not correctly declared
-15       search argument does not fit in declared array
-16       QSS.TYPE not correct
-17       tbl argument not correct
-18       no definition found in def
-21       flag LOOKUP.FOR.STRUCT is used; search argument must be a string
-22       search argument not correct; probably a size problem – size of search 
            must match size of an element in tbl if LOOKUP.FOR.STRUCT is set or
            (if LOOKUP.FOR.STRUCT is not set) must be at least the sum of lengths 
            of the key fields (set by qss.length())
-23       search argument not correct; probably a type problem

Context
Bshell function.
__________________
//Bernd
Reply With Quote
  #3  
Old 25th January 2017, 16:13
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 573
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hi,

Thanks a lot. I was trying to store 5 numbers in array tmp, and then sort them.
After sorting tmp using qss.sort, when I am printing value of tmp(1,1), It is supposed to be 6, but it is showing 10.The code compiles but array is not sorted. The code is given below:

string tmp(10,5)
store.long(10,tmp(1,1))
store.long(9,tmp(1,2))
store.long(8,tmp(1,3))
store.long(7,tmp(1,4))
store.long(6,tmp(1,5))

long sort_def(1,4)

qss.start(sort_def,1,1)
qss.way(sort_def,1,QSS.UP)
qss.type(sort_def,1,DB.LONG)
qss.sort(tmp,sort_def,1)
t = load.long(tmp(1,1))
message(str$(t))

Can anybody solve, what could be the problem ?

Vishal
Reply With Quote
  #4  
Old 25th January 2017, 19:20
rahul ingale rahul ingale is offline
Member
 
Join Date: May 2011
Location: Hyderabad
Posts: 33
rahul ingale is on a distinguished road
Baan: baan infor - DB: sql - OS: windows xp
you are sorting one element as you have given 3rd argument to qss.sort function which state how many element to be sorted.just give 2 arguments to sort whole array.
__________________
IRL
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
What is mean by spooler and what is it's purpose? Nammy2015 Tools Development 1 5th April 2013 09:52
Purpose of ttadv120 peturba Tools Administration & Installation 2 14th May 2008 10:48
using dll tiitmdll0003 ckassab Tools Development 2 7th December 2004 01:52
What purpose does Special depn code in initial setup serve (Fixed Ass) Nazeem Finance, Invoicing and Integration 2 10th April 2002 13:51
Purpose of Sessions NPRao Tools Administration & Installation 2 8th November 2001 18:13


All times are GMT +2. The time now is 15:54.


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