From: Tristan Knowles Date: 2005-07-15T03:48:21+09:00 Subject: Re: Help: very simple script problem 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? This is how I have been approaching it, its obviously not working, and I'm still not up to speed at working out how to use methods based on the online reference details only. ===== if File.exists? Log_File lines = File.open(Log_File).readlines lines.each_with_index do |line, index| index % 2 == 0 ? color = "#dddddd" : color="#cccccc" while index <= 50 puts "\n #{index}\n #{line}" puts "" end end ===== Am I even approaching this the correct way? Or should this be handled once step before with a grep statement? Thanks again. Tristan ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com