Void value expression for 'retry'

following code returns,
retry.rb:13: void value expression

What is wrong with this code?

#!/usr/bin/env ruby

retry_count = 0
retry_max = 4

begin
        sleep 30

rescue Interrupt
        if ( retry_count < retry_max)
                retry_count++
                retry
        end
rescue
        raise
end

Thanks,
Mohammad

following code returns,
retry.rb:13: void value expression

What is wrong with this code?

#!/usr/bin/env ruby

retry_count = 0
retry_max = 4

begin
        sleep 30

rescue Interrupt
        if ( retry_count < retry_max)
                retry_count++

retry_count++ is not valid ruby code. so that could be causing some
problems.

                retry

···

On 10/1/07, Mohammad Khan <khan.mohammad@acm.org> wrote:

        end
rescue
        raise
end

Thanks,
Mohammad

Mohammad Khan wrote:

following code returns,
retry.rb:13: void value expression

What is wrong with this code?

#!/usr/bin/env ruby

retry_count = 0
retry_max = 4

begin
        sleep 30

rescue Interrupt
        if ( retry_count < retry_max)
                retry_count++
                retry
        end
rescue
        raise
end

Thanks,
Mohammad

Ruby doesn't have the post-increment (++) operator. Use retry_count += 1 instead.

···

--
RMagick OS X Installer [http://rubyforge.org/projects/rmagick/\]
RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618\]
RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html\]