repeat with each

Paul Foraker paul at whitefeather.com
Mon Sep 22 09:28:44 EDT 2014


On Mon, Sep 22, 2014 at 6:13 AM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> repeat for each word myWord in field "Just One"
>   put thisWord & comma after myNewdata
> end repeat
> sort items of myNewData
> put char 1 to -2 of myNewData into field "Just One"
>

This loop generates a string that (1) starts with an empty item and (2)
repeats the word "thisWord", deleting the last "d".

(1) The last item after the loop finishes is empty -- the comma at the end.
After the sort, however, that comma is at the front of the variable.

A simple solution would be to replace the last line with

put char 2 to -1 of myNewData into fld "Just One"

(2) Instead of "put thisWord", it should be "put myWord".  Or, "repeat for
each word thisWord"

-- Paul



More information about the use-livecode mailing list