From: Dark Ambient Date: 2006-06-28T21:01:27+09:00 Subject: Beginners question: branching and ends trying to figure out exactly where 'end' needs to be in my code. I'm using Scite and find that often time it will report 'expecting kEND' at the last line of the code and not where the kEND should actually be. It would be nice if there was more accuracy but I won't expect it. so if this is my code somearray.each do |x| anotherarray.each do |y| if x == y ......do something....... else .....do something.......... end # I have this 'end' for the if/else statement end # this 'end' is for the somearray loop end # and this is the one question, but I'm guessing (i know not good to guess) that this # one is needed for the anotherarray loop ? Would this be correct ? One thing I've found is that having the right number of ends will make the code execute but having them in the wrong place will have surprising results. TIA Stuart