Hi,

At Sat, 14 Feb 2004 00:54:55 +0900,
Ara.T.Howard wrote in [ruby-talk:92793]:
> return a value.  i was not clear enough, let me try again:
> 
> def meth s
>   x =
>     block_meth do
>       if s =~ /forty/
>         return 40
>       else
>         return 0
>       end
>     end
>   x + 2
> end
> 
> def block_meth; yield; end
> 
> p(meth('forty')) # this prints 40 - i want it to print 42 

Use break or next instead of return.

-- 
Nobu Nakada