Tristan Knowles said:
> Just another quick question regarding flow control.
>
> What variable can I refer to, and what method do I use
> to create a while loop so that only x amount of lines
> are shown at once from a file?

I think this is what you wanted to do:

if File.exists? Log_File
  lines = IO.foreach(Log_File).readlines
  lines.each_with_index do |line, index|
    index % 2 == 0 ? color = "#dddddd" : color = "#cccccc"
    puts "<tr bgcolor=\"#{color}\">\n
    <td>#{index}</td>\n  <td>#{line}</td>"
    puts "</tr>"

    break if index > 50
  end
end

But there are definitely several improvements that could be made on this.
For example, the above reads all the lines, whereas this only reads the
lines you care about from the file:

if File.exists? Log_File
  index = 0
  IO.foreach(Log_File) do |line|
    index % 2 == 0 ? color = "#dddddd" : color = "#cccccc"
    puts "<tr bgcolor=\"#{color}\">\n
    <td>#{index}</td>\n  <td>#{line}</td>"
    puts "</tr>"

    break if (index+=1) > 50
  end
end

Ryan