That's a little different, in that it uses a value to find a prop to go
with it. Unfortunately, by using GetOne, you let Lingo go through and find
a prop for a given value, which besides being slow(er), will fail if you
have the same value under two different props. Consider:
m=[#Name:"Joe", #Password:"Joe", #Name:"Bill", #Password:"Bill"]
Under your approach, if you do a getOne(m, "Joe"), you'll always get #Name,
which is the first property that has a value that matches.
If you take the way I did, and iterate through the props using GetPropAt()
and GetAt(), you'll avoid this problem.
- Tab
At 02:14 PM 3/28/01 +0100, Karina Steffens wrote:
> > both, I guess, but the main point was to pull out all of a
> > specific property.
>
>Oops.. I think I missed that little bit...
>
>Same handler, slightly modified:
>
>on propLst, myProp
> mainList = [ [#puzzle: [ [#title: "One"], [#level: "Moderate"], [#word:
>"Lingo"], [#word: "Director"] ] ], [#puzzle: [ [#title: "Two"], [level:
>"Beginner"], [#word: "Action"], [#word: "Flash"] ] ] ]
>
> repeat with subList1 in mainList
> repeat with subList2 in subList1
> repeat with subList3 in subList2
> repeat with myValue in subList3
> if subList3.getOne(myValue) = myProp then
> put myValue
> end if
> end repeat
> end repeat
> end repeat
> end repeat
>end
>
>Karina
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/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/LUJ/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!]