sort compare function with refinement?
[1/2] from: raimund:swol at: 23-Feb-2001 21:55
Hi, I try to sort a block of objects using a compare function with refinements to select the member of the object I want to sort after. But I always get an error if I use a refinement? How do I have to do this? I tried the following: sort/compare book-db :compare-book/title This resulted in the following error: ** Script Error: compare-book expected A argument of type: object. ** Where: sort/compare book-db :compare-book/title If I do sort/compare book-db :compare-book the result is as expected but I have to write a separate function for every member of the object (the object is a book having the members title/author/info). Calling the function directly does work though:
>> compare-book/title book-db/3 book-db/4
== true Raimund
[2/2] from: lmecir::mbox::vol::cz at: 26-Feb-2001 21:46
The only solution I can suggest is: sort/compare book-db func [x y] [compare-book/title x y] Regards Ladislav