Report Sorter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Report Sorter

keith1y
Hello Lukas,

Is the report column sorter supposed to be able to handle nil values?

This code (below) looks like it is trying to be tolerant But what if

one= 'string'.
two = nil.

thanks in advance

Keith

====
sort: aFirstObject and: aSecondObject
    | one two |
    one := self valueFor: aFirstObject.
    two := self valueFor: aSecondObject.
    (one respondsTo: #<=) ifFalse: [
        one := self formatter value: one.
        two := self formatter value: two ].
    ^ one <= two

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki