dhowells
20th October 2010, 22:36
I have a string array that I'm using the qss.sort to sort it. When it does the sort (strings) in ascending order, it places all the values at the bottom. So say my array is 100 elements and 20 are filled. They will be in ascending order starting at element 80; thru element 100. Below are the basic commands / definitions.

long sort.def(1,4)

qss.start(sort.def, 1, 1)
qss.way(sort.def, 1, QSS.UP) | Ascending
qss.type(sort.def, 1, DB.STRING)
qss.length(sort.def, 1, 20)
e = set.mem(master.item.ary, "") |does same thing w/wo this line
...fill first x elements
e = qss.sort(master.item.ary, sort.def)

mark_h
20th October 2010, 22:50
How is master.item.ary declared? Almost looks like it has a default of spaces or maybe it is fixed.

dhowells
20th October 2010, 22:57
It is defined as
domain tcitem master.item.ary(50000)

I tried it as fixed and without fixed. I also tried it with/without the set.mem. I thought that the set.mem may be padding it with spaces, which were being seen as values.

mark_h
20th October 2010, 23:30
Have you tried declaring it as string of 20 or 32, which ever your iterm length is?

günther
21st October 2010, 11:48
In your case, where your array contains more elements than really needed, you shoud use set.max(master.item.ary).

(In other situations, when all elements of an array are used, this is not necessary. Typically: read a table and use alloc.mem).

Günther

Hitesh Shah
25th October 2010, 19:18
Agree with gunther that u should use alloc.mem function as against static declaration .

There are lots of sample on this board (search alloc.mem , in-memory etc )

dhowells
25th October 2010, 20:14
The alloc.mem did do the trick. Plus, got to learn something new. Which is nice after 16 years... Thanks to all.