From: Robert Klemme Date: 2008-02-16T07:15:02+09:00 Subject: Re: Which data-type can I use for this task? On 15.02.2008 17:32, Adna rim wrote: > Hi, > I have a little question. I have a list here like this: > > street > house > person > age > > street > house > person > age > > street > house > person > age > .... > > Now I wanna store them in a data type like an array. I tied this here: > > information = [Street=[],House=[],Person=[],Age=[]] > > but If I wanna now fill it like > > information.Street << firstentry > > I always get an error telling undefined method Street... Yes, because you assigned to the global constant "Street" and did not define a method with that name. > With which datatype do I best realize this? See Siep's suggestion. Of course it depends on how you want to work with the data but the most likely case is that you treat one set of street, house etc. as a single record so it makes sense to do it the way Siep suggested (probably using a constant for the Struct and not a local variable because Struct.new really defines a new class). Cheers robert