From: Martin DeMello Date: 2008-07-12T02:27:40+09:00 Subject: Re: block variable not working how I expect it to work On Fri, Jul 11, 2008 at 10:20 AM, Karl von Laudermann wrote: > On Jul 11, 1:11 pm, Martin DeMello wrote: >> Therefore your code should be: >> >> def myblock >> testvar = ['cool', 'array'] >> testvar = yield testvar >> print testvar >> end >> >> myblock do |stuff| >> return "dumb string" >> end > > I was going to post a response similar to yours but you beat me to it. > However, I tried your version, and the return statement is causing an > error. You instead just want to do: > > myblock do |stuff| > "dumb string" > end oops, yes - that'll teach me to type code straight into email. been doing too much javascript of late! martin