read from file until a line begins with a certain word

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Sun Sep 17 17:48:16 EDT 2017


Thanks for mentioning this.
At the moment i stop reading the file after the tenth  finding. So i did not yet run into a problem.
Adjusted my script now.

Regards,
Matthias



Matthias Rebbe
+49 5741 310000
‌wirmachen.software <http://wirmachen.software/>‌

> Am 17.09.2017 um 23:15 schrieb Monte Goulding via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
> 
> 
>> On 18 Sep 2017, at 6:13 am, Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com <mailto: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
> 
> Cheers
> 
> Monte
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the Use-livecode mailing list