How to add a new item into the end of an existing line?
jhj at jhj.com
Mon Mar 16 15:31:22 EDT 2015
There is a good explanation of chunk expressions in the User Guide, starting on p. 168.
You get to the User Guide by opening the Resource Center from the toolbar, which has a link
to download the PDF of the User Guide. There is lots of good stuff in there that explains the basics.
What is in tRecord? It needs to be the line NUMBER, not the contents of that line.
If tRecords contains:
put comma & "foo" after line 2 of tRecords -- will change tRecords to:
But instead if you put "second line" into tRecord
put comma & "foo" after line tRecord of tRecords -- will fail at runtime
because the variable tRecord doesn't evaluate to a line NUMBER or range of numbers.
It compiles OK because tRecord might contain a number at runtime, it can't tell.
> On Mar 16, 2015, at 11:53 AM, Keith Clarke <keith.clarke at me.com> wrote:
> Weirdly, using this form…
> put comma & tInsert after line tRecord of tRecords
> ... Compiles OK but then fails on run with (Chunk: error in range start expression)
More information about the Use-livecode