sorting - Strange DataWindow sort with negative numeric string -


i have sortable datawindow in powerbuilder (both 9 , 12.6) giving me collywobbles. have field called category, defined char(4). form populates field restricts 4 numeric characters. smartass tester me saw , went "hmm, doesn't disallow negatives, it?" , checked. didn't. tried sorting field. if query in oracle, sorts predicted, -001 @ top. if take datawindow, though, starts out sorted obj_no, , tell sort category instead, sorts in following order:

... 0009 -001 0010 ... 

i'm having darnedest time coming reason ever make sense. else?

eta: @avk, looks kind of this.

if ls_sort_cols[i] <> '-' ls_sort_str = ls_sort_str+' '+ls_sort_cols[i]+' a' if len(ls_sort_str) > 0     ldw_win.setsort(ls_sort_str)     ldw_win.sort() end if 

i've confirmed value of ls_sort_str going setsort line "category a".

it's better code this:

if len(ls_sort_cols) > 0     ldw_win.reset()     ldw_win.importstring( ls_sort_cols)     ldw_win.setsort("category a")     ldw_win.sort() end if 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -