From: Nathan Taylor-Hoover Date: 2007-06-28T01:09:24+09:00 Subject: missing kEND for if statement, but not for a case statement? ------=_Part_40909_15648355.1182960565578 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I am having some trouble figuring out why I keep getting an unexpected kENSURE expecting kEND error. I have to sets of code and the first set uses a case statement with the same amount of end keywords. This set runs fine. The second set uses an if statement and will not pass a syntax check. Any advice is greatly appreciated. I really need to figure out how to go with the if statement because the === operator that case statements use do not work the way I need them to when a regex object is placed in the right side of the expression. This is a rough example of my syntax. The actual code has different values but the structure is the same. I've used VIM with matchit and can not find any errors. 1st set; begin loopbreak = false while loopbreak != true str = gets case(str) when 'help', 'HELP' puts help when 'quit', 'QUIT' loopbreak = true when 'options', 'OPTIONS' puts options else puts "{#str} is not a valid command" end end ensure somehousecleaning() end 2nd set begin loopbreak = false while loopbreak != true str = gets if str =~ /help|HELP/ puts help else if str =~ /quit|QUIT/ loopbreak = true else if str =~ /options|OPTIONS/ puts options else puts "{#str} is not a valid command" end end ensure somehousecleaning() end ------=_Part_40909_15648355.1182960565578--