comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Nested data structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Nested data structures [message #89918 is a reply to message #89916] Wed, 24 December 2014 16:11 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 12/24/14, 2:29 PM, wlandsman wrote:
> I am trying to build a data structure that will allow me to specify a person by his State, city, street and street. (This is not my actual need, but it is analogous.) Thus I might specify (as metacode)
>
> ['Colorado']['Boulder']['Pearl'][9990] = 'John'
>
> I assume this can be done with nested hashes or dictionaries, but I am having difficulty figuring out how to start. I started writing something like
>
> person = [hash('colorado',['boulder','Denver'], hash('Arizona',[Tuscon','Phoenix'])
>
> but I get lost in making the nesting clear. thanks for any help. --Wayne
>
>

Is something like this what you are trying to do?

IDL> person = hash('Colorado', hash('Boulder', 1, 'Denver', 2),
'Arizona', hash('Tucson', 3, 'Phoenix', 4))
IDL> (person['Colorado'])['Denver']
2

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDLBridge problem with unknown ExecuteTimer method
Next Topic: ERROR: Attempt to subscript B with is out of range

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:04 PDT 2025

Total time taken to generate the page: 0.00443 seconds