SKILL Q: Getting a Sorted List of db objects?

E

Edward

Guest
The function geGetSelSet() seems to build a list in the same order
that the objects were selected. Normally, I like this. But I want
to make a copy of this list of db-objects in alphabetical order with
respect to ~>objType .

Here is my code:

(sort
(geGetSelSet)
(lambda (x y)
(alphaNumCmp
(dbGetq x "objType")
(dbGetq y "objType"))))

Running this code seems to have no effect whatsoever. Whatever item I
selected first is still always the first item in the list, as if I
never ran the list through a sort at all. What am I missing? Thanks
in advance.

Edward
 
Edward wrote:
(sort
(geGetSelSet)
(lambda (x y)
(alphaNumCmp
(dbGetq x "objType")
(dbGetq y "objType"))))
Try alphalessp() instead of alphaNumCmp().

alphaNumCmp does not seem to work with sort, i guess this is because
sort expects a boolean (nil or t) and alphaNumCmp returns an integer
(-1, 0 or 1) which is always "true"...

Stéphane
 
On Aug 8, 5:34 pm, "S. Badel" <stephane.ba...@REMOVETHISepfl.ch>
wrote:
Try alphalessp() instead of alphaNumCmp().
FWIW, there are some perhaps usable sorting & uniquifying SKILL
snippets at the older posting
http://groups.google.com/group/comp.cad.cadence/browse_thread/thread/3ee0ddf37c16bca7/017e699e810d4208?lnk=gst&q=gianni+sort+skill&rnum=4&hl=en#017e699e810d4208

http://tinyurl.com/ywgowd
 

Welcome to EDABoard.com

Sponsor

Back
Top