From: Robert Klemme Date: 2008-02-14T22:36:16+09:00 Subject: Re: Problem usning 'OR' operator in 'IF' condition? 2008/2/14, dare ruby : > Thank you paul and mark your informations have been very useful to me. > > but it works fine when the condition changes like, > > if @character == 'R' || @character == 'r' > raise " Expected 'R' after 'E' in version Declaration" > end Are you sure? From what I gather this logic is still flawed. I mean, you want to throw if it is *neither* "r" *nor* "R". So you would need to express that in your conditions, e.g. if @char != 'R' && @char != 'r' ... if ! ( @char == 'R' || @char == 'r' ) ... (btw, see Morgan's Laws: http://en.wikipedia.org/wiki/De_Morgan's_laws ) Here's an alternative way raise "..." unless /^r$/i =~ @character Kind regards robert -- use.inject do |as, often| as.you_can - without end