You're getting the same results from both examples.  You're getting the
value of the first property.  In pl, the property is "31", and if you
notice, you're not getting it returned.  Likewise, with vpl, you're not
getting the property returned, either.  From what I understand, using
getPropAt is the only way of obtaining the property name and value pair.  If
you don't need to access the data via property names, (i.e. vpl.TB199), then
it would be easiest to just nest each entry inside another list, such as:

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

But then I'm not sure why you'd want to use the property structure like you
have it.  You might want to do something like this:

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

Then you can retrieve an entire entry by using vpl[1] or you could get just
the name or data with vpl[1].name or vpl[1].data.

Charlie Fiskeaux II
Media Designer
The Creative Group
www.cre8tivegroup.com
859/858-9054x29
cell: 859/608-9194

----- Original Message ----- 
From: "Kerry Thompson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 12:41 PM
Subject: <lingo-l> List bracket access


> 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!]
>


[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