From: Navaneet Kumar Date: 2010-07-08T19:37:53+09:00 Subject: Re: Changing registry values with Win32::Registry Heesob Park wrote: > Hi, > > 2010/7/8 Navaneet Kumar : >>> non-existing keys, you can try this: >> having null. I mean the 'name' key is not exist in that path. How do we >> handle this in ruby. >> > You can handle it like this: > > begin > if (reg.read_i(name)!="") > return reg.read_i(name) > end > rescue Win32::Registry::Error => e > if e.code == 2 > puts "#{name} key not exist!" > end > end > > > Regards, > > Park Heesob Thanks Park... I was trying the same and it works for me. Is is possible to handle without handling the exception? -- Posted via http://www.ruby-forum.com/.