sort list alphabetically (for basic database primer series)

Alex Tweedly alex at tweedly.net
Sat Jan 8 15:01:48 CST 2005


Bob Hartley wrote:

> Hi all
>
> I have a list that is creatred from another field. IE field "Item"'s 
> entries are put into a "ItemList" field via this script......
>
> on mouseup
>   repeat with n = 1 to the number of cds in this stack
>     put fld "Item" of cd n & return after theList
>   end repeat
>   delete last char of theList -- clear trailing return
>   put theList into fld "ItemList"
> end mouseup
>
> Now I want to sort this list alphabetically and in future double click 
> on a line to go to the respective card. I think I'll do this via a 
> sort popup or menu.
>
> Any Idea I tried this from the runrev docs
> on mouseUp
>   sort items of field "ItemList" by word 1 of each
> end mouseUp

You built the field by putting each one onto a separate line - so I'd 
expect you to use "lines" rather than "items" -
    sort lines of field "ItemList" by word 1 of each
or simply
   sort line of field "ItemList"
which should do the same.

-- Alex.


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 03/01/2005



More information about the use-livecode mailing list