From: Gavin Sinclair Date: 2002-09-27T08:53:45+09:00 Subject: Re: hash missing value ----- Original Message ----- From: "MikkelFJ" > As an extension or alternative to this, what about a two value assigment > where the second value is assigned if the first value is false or nil: > > files = { "item1" => "myfile.rb", "item2" => "mytestdata"} > window.caption = files[current_item] alternative "Untitled" > or > window.caption = files[current_item] \/ "Untitled" > > Mikkel window.caption = (files[current_item] ||= "Untitled") Gavin