Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!kuhub.cc.ukans.edu!kuento From: kuento@kuhub.cc.ukans.edu Newsgroups: comp.sys.mac.hypercard Subject: Help! How to alphabetize items within text fields? Message-ID: <27868.2790c634@kuhub.cc.ukans.edu> Date: 14 Jan 91 02:42:28 GMT Organization: University of Kansas Academic Computing Services Lines: 18 I devised a procedure by which I could click on a button and do an alphabetic sort routine WITHIN a text field. The problem is, the code is lengthy, the loops monstrous, and it takes nearly 10 minutes to sort out a jumbled list of 100 words separated by commas. It's almost faster to do it by hand! Does anyone have an idea for a fast way to alphabetize items within a text field, or is there some simple permutation of SORTing that can be applied within fields? My present approach is popping out consecutive pairs of items, comparing them, and putting the "lower-valued" one first...this works fine when the words must be moved "back" in the list, but to push them "forwards" requires loops...so if a word beginning with "a" is at the end of the field, it takes *forever* for it to move to the front (one loop for each advance forwards one spot). There has GOT to be a better way! Thanks (and apologies if this has come up before), -------(please include "DY" in subj header of mail to this user)-------- Doug "Speaker-To-Insects" Yanega "UT!" Bitnet: KUENTO@UKANVAX My card: 0 The Fool (Snow Museum, Univ. of KS, Lawrence, KS 66045) "You can keep my things, they've come to take me home" - Peter Gabriel