read from file until a line begins with a certain word

J. Landman Gay jacque at hyperactivesw.com
Sun Sep 17 20:16:43 EDT 2017


You're right of course, I had a thinko.

On 9/17/17 4:15 PM, Monte Goulding via use-livecode wrote:
> 
>> On 18 Sep 2017, at 6:13 am, Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> thanks for that code sample. I was not aware that i can use EOF in a repeat loop as condition. I always thought that it only can be used in a read command like
> 
> I was not aware of it either and can’t see anything in the engine that indicates it should work.. perhaps I’m missing something… `eof` is a constant. Really the repeat loop doesn’t know which file the `eof` might be referring to so it would be pretty weird syntax.
> 
> As far as I know you would need to use something like:
> 
> local tResult
> repeat until tResult is eof
>    read from file tFile until tDelim
>    put the result into tResult
>    -- process the text here
> end repeat


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the Use-livecode mailing list