Adam Akhtar wrote:
> I dont believe i only just found out that functions can return more than 
> one variable in ruby!
> 
> How I missed that i dont know.
> 
> Thank you very much for your help on that.

No problem.

Really they are just returning an array, and that array may (or may not) 
be split at the receiver.

irb(main):001:0> def foo; return 1,2; end
=> nil
irb(main):002:0> x = foo
=> [1, 2]
irb(main):003:0> x, y = foo
=> [1, 2]
irb(main):004:0> x
=> 1
irb(main):005:0> y
=> 2
irb(main):006:0> def bar; return [1,2]; end
=> nil
irb(main):007:0> x = bar
=> [1, 2]
irb(main):008:0> x, y = bar
=> [1, 2]
irb(main):009:0> x
=> 1
irb(main):010:0> y
=> 2

I believe there's no difference whether you build an array to return, or 
give multiple values to return.
-- 
Posted via http://www.ruby-forum.com/.