Inserting new lines in a Scrolling List Field programatically

Sarah Reichelt sarah.reichelt at gmail.com
Sun Jan 29 06:38:11 EST 2006


> I have a Scrolling List Field that I need to update
> programmatically.  The code to populate the line is
>
>  put "29/01/2006" && Tab && "Full Shed" && Tab && "12"  && Tab && "Full
> Shed" into fld "fldShed"
>
> This works fine, except of course, it overwrites the current
> line with new data.  I tried adding a return to the end
> of the line above, but that doesn't seem to do it.  Note
> that I will not know how many lines there will be at runtime.
>

As others have already said, you can use "put after" to append lines
of text e.g.
    put cr & "29/01/2006" && Tab && "Full Shed" && Tab && \
        "12"  && Tab && "Full Shed" after fld "fldShed"

Another very useful trick is this one liner that deletes any blank lines:
     filter fld "fldShed" without empty

Cheers,
Sarah



More information about the use-livecode mailing list