Deepali
21st January 2004, 06:39
Hi
i am getting problem in qss.sort method.
I have array of 41 characters having following fields:
License(6) | Attached Amount (14) | Year (4) | Balance Amt (14)
All these fields are stored as str$(field).

I want to sort this array (array1 ) with Year and Balance amount

code:
qss.start (sort_def , 1 , 23 )
qss.way ( sort_def , 1 , QSS.UP )
qss.type ( sort_def , 1, DB.LONG )
qss.start (sort_def , 2 , 28 )
qss.way (sort_def , 2 , QSS.UP )
qss.type (sort_def , 2, DB.DOUBLE)
dummy = qss.sort(array1 , sort_def)

Result: It sorts the array yearwise but not balance amount wise
Plz help me out.
-Deepali

JaapJD
21st January 2004, 14:25
If you are using str$(), the result is not a double, so use DB.STRING i.s.o. DB.DOUBLE (and DB.LONG).

For the amount you should use another function (edit$ or sprintf$) to get them right-aligned, because you need a numeric sort.

Deepali
22nd January 2004, 06:17
hi
thanks for ur reply.

what i did is :
i added Year as str$ but for adding amount , i used store.double
and then sorted on Year & Amount.
Its working fine but still i confused - bcoz it gives problem for double and not for long.

Regards,
Deepali