Yes, the parsing of string representations of property lists (including lingo scripts) has a number of limitations that the lists themselves don't have.

e.g, this works:

list = [1: "One", 2: "Two"]
list.setaprop(-1, "MinusOne")
put list
-- [1: "One", 2: "Two", -1: "MinusOne"]

but this results in a confusing "Comma Expected" error during compile:

list = [1: "One", 2: "Two", -1: "MinusOne"]


Another fun thing is how it will make up an integer property based on position if you forget to give one:

put [1: "One", 2: "Two", "Unlabeled"]
-- [1: "One", 2: "Two", 3: "Unlabeled"]


... and lets not start on <void> vs void.

If you really need to do any of these things, use either setAProp as you have seen, or get the excellent vList Xtra.

-- Mark Whybird
(who is looking for work in Australia)

[EMAIL PROTECTED] wrote:
hi Julian,

yes, this does produce an error
x = [ [1,2,3,4,5]:[6,7,8,9,0] ]
-- err

but this apparently doesn't:
x = [:]
x.setaProp( [1,2,3,4,5], [1,2,3,4,5] )
put x
-- [[1, 2, 3, 4, 5]: [1, 2, 3, 4, 5]]

cheers,
benjamin ;)



julian weaver schrieb:
hi,

i've inherited a project that builds a prop list from linear lists where both the property and value are linear lists, e.g.

[ [1,2,3,4,5]:[6,7,8,9,0], ... ]

It's more of a query than actually looking for a fix but the list functions fine as it's built on the fly but generates a script error when built from a field or message window.

i'll rewrite it as it's a silly way to build a pivot table but i'm just a tad curious.

thanks,

Julian

[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