| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Bug: SORT DOWN #11939 Posted by: gabeh 2007-10-09 01:20:52 | Jeff,
Could you look into this?
I encountered a problem with SORT DOWN.
Problem: After executing "SORT DOWN", it seems missing one entry and enconteres a "no value" condition. But if "SORT DOWN" is following an asending order sort, as commented out below, it works as expected.
A test script is as follows:
/* Test Sort Descending Order */ do s = 1 to 10 d = /*100 +*/ s sdata.s = d end
/*say "Testing Ascending Order" SORT sdata. A
send = sdata.0
do s = 1 to send say sdata.s end*/
say "Testing Descending Order" SORT DOWN sdata. A
send = sdata.0
do s = 1 to send say sdata.s end exitsgabe | 2. The docs indicate that you don't need to set sdata.0 #11940 | but try setting sdata.0 to 10 before the sort and you'll see it works. | 3. Yes, it works. but... #11941 Posted by: gabeh 2007-10-09 05:39:51 | should it work without setting sdata.0? It works file with just "SORT" asending order.
Anyway, thank you. I will change my script per your suggestion.sgabe | 4. Have to be honest, #11944 | I never have a stem variable without the .0 variable as well. From my point of view, I can't imagine a scenario where I'd be able to code WITHOUT knowing the value in sdata.0. Almost any time you use a stem, you end up with something similar to
DO i = 1 TO sdata.0
code code
END
| 5. It should work without the .0 variable #11946 Posted by: DougA 2007-10-09 23:12:48 | From the doc file:
Note: All tails of the stem are sorted. It is not possible to exclude any tails from being sorted. A tail with the name StemName.0 is ignored in the sort, and its value will be overwritten (with the "sort count") after the SORT.
From my tests:
A normal sort does work without setting the .0 entry, but the DOWN version loses the last sorted entry unless the .0 is preinitialized to anything.
Changing the subject some, but leaving the 'A' off of the sort command, still runs, but produces a mixed up result.Doug | 6. Bump #13402 | It would be nice if this bug was fixed. Basically, sort down doesn't seem to be setting the value for stem.1 | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|