From: Michael Libby Date: 2008-08-05T23:15:17+09:00 Subject: Re: hash code reference - this only returns 'nil' please help me On Tue, Aug 5, 2008 at 8:59 AM, Mmcolli00 Mom wrote: > Thanks everyone! > > I thought about this being an array and I did this: > > StrgErrFieldID = ErrFieldID.to_s > > Then I referenced h[StrgErrFieldID] > This worked! > That will work as long as you can guarantee only one element in the Array. The fact that the method returns an array and not a single value indicates to me that there may be times where multiple elements are a real possibility. You may want to consider accessing the first element explicitly with ErrFieldID[0] instead of using to_s. You may also want to consider what to do if you get more than one element returned in that array. -Michael