Path: utzoo!attcan!uunet!snorkelwacker!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: Sorting part of a stack? Message-ID: <45570@apple.Apple.COM> Date: 11 Oct 90 16:44:46 GMT References: Distribution: comp Organization: Apple Computer Inc., Cupertino, CA Lines: 29 In article dwiggins@atsun.a-t.com (Don Dwiggins) inquires: >I have a stack with 3 backgrounds, with several cards per. I'd like to sort >just the cards within a given background. Is there an easy way to do this? Often the simplest approach when sorting is to use a function called by sort. For instance, on sortMeUp theBackground sort this stack by justBackground(theBackground) end sortMeUp function justBackground myBackground if the short name of this background is not myBackground then return "z" else return field "Name" end justBackground The above will sort cards of the selected background by the background field "Name", and sort cards of all other backgrounds to the end of the stack (leaving their relative ordering unchanged). Of course, much more complicated functions can be used. -- ========= jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.sf.ca.us | compilation copyright without my permission. ______________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. |