>>      if $delay1==0;
>>         $delay1 = $delay1+(1);
>>      elsif $delay1==1
>>         $delay1 = $delay1+(1);
>>      end
> 
> I'm not sure what the above is trying to do. Both branches of the 'if' 
> are saying $delay1 = $delay1 + 1, so you could replace all that with 
> just
> 
>     $delay1 = $delay1 + 1

Sorry, what I said was completely wrong there; I misread your code.

What you're actually doing is if $delay1 is 0 or 1, then you increment 
it, otherwise you leave it alone. But I don't think you really want to 
do that.
-- 
Posted via http://www.ruby-forum.com/.