[comp.sys.mac.hypercard] multi-level sorting ?

21602MR@MSU.BITNET (Mark Rosenberg) (08/11/89)

Is it possible to do multi-level sorting in hypercard?  Say sort by field zip
and then by word two of field name ?  Are there xcmds/xcfns ?  It seems an
obvious omission, are there rumors about these type of capabilities in HC 2.0 ?


Thanks,

Mark Rosenberg  <21602MR@MSU>
Education Systems Development
Michigan State University

frankf@Apple.COM (Frank Flynn) (08/11/89)

In article <15021602MR@MSU> 21602MR@MSU.BITNET (Mark Rosenberg) writes:
>Is it possible to do multi-level sorting in hypercard?  Say sort by field zip
>and then by word two of field name ?  Are there xcmds/xcfns ?  It seems an

Every sort in hypercard is multilevel.  Unlike most databases when you sort
in hypercard it stays sorted (evan after you quit).

to sort like you wanted try this:

on mouseup
  sort by word 2 of fld name
  sort by field zip
end muoseup

when it sorts by zip since the cards are in alphabetical order by last name
it will keep that order within each zip code.

Frank Flynn     frankf@apple.com

Barry.Chern@f200.n226.z1.FIDONET.ORG (Barry Chern) (08/12/89)

It is very easy to do multi-level sorts with HyperCard, although they are
either somewhat confusing or somewhat slow. You can say "sort by field one 
and field two" but only if the information in the two fields is totally
consistent, as in numbers with the same number of digits or words with at
least as long as is significant to the sort, as the fields will be
concatenated and then sorted.
The pure way to do it is to do one sort and then another, with the least
significant sort done first. In other words, the opposite of the order you 
think it should be done in:
    sort by word two of field name
    sort by field zip
This should give you just what you want.


--  
Barry Chern via cmhGate - Net 226 fido<=>uucp gateway Col, OH
UUCP: ...!osu-cis!n8emr!cmhgate!200!Barry.Chern
INET: Barry.Chern@f200.n226.z1.FIDONET.ORG