Menu

#984 error in sample

4.1.1
closed
none
5
2013-11-22
2011-02-16
bugstumbler
No

Open Object Rexx™ Reference, Version 4.1.0 Edition, December 2010
5.3.18.1. Sorting non-strings, pp. 281

a = .array~new
a[1] = .Employee~new(654321, "Fred")
a[2] = .Employee~new(123456, "George")
a[3] = .Employee~new(333333, "William")
a~sort
do employee over a
say employee -- sorted order is "George", "William", "Fred"
end
return

::class Employee inherit Comparable
::method init
expose id name
use arg id, name
::method id attribute
::method name attribute
::method compareTo
expose id
use arg other
return id~compareTo(other~id) -- comparison performed using employee id
::method string
expose name
/ use arg name / <--------------------------------remove this line to get correct results
return "Employee" name

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2012-02-03

    Committed revision 7471. For docs/rexxref

    Committed revision 7472. For docs/branches/4.1

    Thanks for opening this up.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-07-16

    The fix for this item was in the 4.1.1 or 4.1.0 release.

     
  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Pending work items: --> none
    • Group: Next_Release --> 4.1.1
     

Anonymous
Anonymous

Add attachments
Cancel