Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Bug: SORT DOWN

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. 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
 
exit
sgabe
Message2. The docs indicate that you don't need to set sdata.0
#11940
Posted by: Michael S 2007-10-09 01:38:13
but try setting sdata.0 to 10 before the sort and you'll see it works.
Message3. 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
Message4. Have to be honest,
#11944
Posted by: Michael S 2007-10-09 14:55:24
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
Message5. 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
Message6. Bump
#13402
Posted by: Michael S 2010-11-08 22:25:23
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 First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0