[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Help with sting compare?
- From: Rici Lake <lua@...>
- Date: Thu, 18 Aug 2005 23:42:08 -0500
On 18-Aug-05, at 11:18 PM, Ron Hudson wrote:
read.io() gets one line from the current file, or standard input.
Actually, that's io.read() :) I assume you actually got it right in
The following little Lua program works (io.lines is a much easier way
of iterating lines of a file, but it's not actually different from the
rlake@freeb:~$ cat hudson.test
rlake@freeb:~$ cat hudson.lua
count = 0
for aline in io.lines() do
if aline == "&" then count = count + 1
elseif aline == "&&" then break
rlake@freeb:~$ lua hudson.lua < hudson.test
<------ end of transcript
I believe that's the expected result.
Can't help you more without knowing a lot more details.