Kerry,

The bracket syntax always gets you what is the value at the given location, whether it's a linear list or a property list.

Yes, you have to use getPropAt, to get the property, then you can use that property to get the value.

Using your example, if you do a:

theProp = getPropAt(vpl, 1)

theProp is assigned "TB199".

Then you can use that to get the value:

put vpl[theProp]

you get [135, 137, 0, 0, 0, 0]


Irv



At 12:41 PM -0400 7/1/03, Kerry Thompson wrote:
I'm trying to retrieve a sub-list from a property list. My property list
looks something like this:

vpl= ["TB199": [135, 137, 0, 0, 0, 0], "TB53": [138, 158, 11, 92, 0, 0]]

I though when I did bracket access, e.g. pl[1], I would get the first
element in the list. In this case, "TB199": [135, 137, 0, 0, 0, 0]

But I'm not. I'm getting the value, i.e., [135, 137, 0, 0, 0, 0]

What's really confusing me is that I'm getting what I expect from a
higher-order list. In the example above, vpl is actually derived from a
larger list which looks like this:

pl = ["31": ["TB199": [135, 137, 81, 114, 0, 0], "TB53": [138, 158, 81,
114, 0, 0]], "n31": ["TB199": [135, 137, 0, 0, 0, 0], "TB53": [138, 158,
11, 92, 0, 0]]]

In that case, pl[1] is ["TB199": [135, 137, 81, 114, 0, 0], "TB53":
[138, 158, 81, 114, 0, 0]]

So, how do I get the entire first element--the property list--from vpl?
Do I have to cobble it together with getPropAt and bracket access (or
getAt)?

Cordially,

Kerry Thompson

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]


--

Multimedia Wrangler.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to