next repeat problem

David Vaughan dvk at dvkconsult.com.au
Tue Aug 17 20:01:18 EDT 2004


On 18/08/2004, at 7:17, Rich Lague <laguer at ucs.orst.edu> wrote:
>
> Thanks Klaus (and Jan!),
>
> Yes, adding the complete descriptor for i did allow my 'next repeat' 
> to run. However, I'm still having problems getting rid of the extra 
> lines in my global variable.
> I have also been trying your suggestion of using 'repeat for each'.
>
> I get an error when I try to 'apply' this script--
>
> ---------------------------------------------------------------
> set the itemdel to tab
> repeat for each line i in fld "daTable"
> if i = empty then
> delete line i of fld "daTable"
> else
> put item 1 of field "daTable"  & return after theList
> end if
> end repeat
>
> --------------------------------------------------------------
> The error I get is "Chunk: error in chunk expression" and it 
> highlights the line "put item 1 of field "daTable"  & return after 
> theList" -- this is a line of the script that worked before...

Rich

Please go back to the sample code sent to you by Klaus. "Repeat for 
each" does not allow you to manipulate the lines of data in your source 
file. By trying to delete something to which it thinks it is pointing, 
you are confusing it, hence the error. When changing data using "Repeat 
for each" always move the lines you want, modified as you please, to a 
new container. As Klaus shows, this simply involves copying non-empty 
lines and is damn fast.

regards
David



More information about the use-livecode mailing list