Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!siemens!pollux!fwb From: fwb@pollux.tmc.edu (Fred Brehm) Newsgroups: comp.sys.mac.hypercard Subject: Re: sorting problems (was: Why?) Message-ID: <56786@siemens.siemens.com> Date: 28 Mar 91 14:32:47 GMT References: <120@lake.scar.toronto.edu> <50903@apple.Apple.COM> Sender: news@siemens.siemens.com Distribution: na Organization: Siemens Corporate Research Lines: 36 In article <120@lake.scar.toronto.edu> barek@lake.scar.toronto.edu (William Barek) writes: > > Secondly, I could not belive that sorting is almost useless (please no > flames). Why. Have you ever tried to sort 2 fields ( one text, other > numeric) or lines in a field that have two columns one is text other is > numeric). To me it is a very basic operation, why this was missed or am > I missing something? In article <50903@apple.Apple.COM> stadler@Apple.COM (Andy Stadler) answers: >Both of these tricks are easy. To sort using multiple keys, just sort the >stack multiple times, starting with the minor sort key and finishing with the >major sort key. For example, if you have a stack with first name and last name >fields, you would sort it like this: [explanation deleted] I think you answered the wrong question. A stable sort makes sorting by multiple keys possible. However, he did not ask about sorting cards. One of Mr. Barek's requests could be fulfilled by a command like sort lines of container by item 2 descending numeric ^^^^^^^^^ but HyperCard 2.0v2 doesn't have this. Another request seems to be sorting of two separate fields. I'm not sure exactly what he means by this, but I'll guess that he would like to consider line i of each of the two fields to be somehow considered as one record. There are work-arounds to both of these things using HyperTalk, but they are pretty ugly. An XFCN or XCMD would probably work much faster. Fred -- Frederic W. Brehm Siemens Corporate Research Princeton, NJ fwb@demon.siemens.com -or- ...!princeton!siemens!demon!fwb