kuento@kuhub.cc.ukans.edu (01/14/91)
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
ollef@sics.se (Olle Furberg) (01/14/91)
In <27868.2790c634@kuhub.cc.ukans.edu> kuento@kuhub.cc.ukans.edu writes: >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 The easy solution to this problem is to upgrade to HC 2.0 . In 2.0 you sort the items by the command "sort items of fld MyField" (if the items are on separate lines you just write "sort fld MyField"). If you, for some reasons don't have HC 2.0 or doesn't want to use it you could try some of the XCMD available for sorting fields. /Olle
phillips@CMSUN.NRL.NAVY.MIL (Lee Phillips) (01/15/91)
In <27868.2790c634@kuhub.cc.ukans.edu> kuento@kuhub.cc.ukans.edu writes:
[...]
Does anyone have an idea for a fast
way to alphabetize items within a text field[...]
I believe the Dartmouth XCMD stack has routines that do this. You should
have it in any case!
Lee Phillips
phillips@cmf.nrl.navy.mil
phillips@fozzie.nrl.navy.mil
phillips@lcp.nrl.navy.mil