Thanks James, who has ever heard of setPropAt????, it's not in the doc�s. I
totally agree with Rob on how to arrange the datastructure , but this is an
editor for a game where the output is constructed in that way. James method
might come in handy, but I've done it in another way which works, so I might
grab the holliday instead ;-)
BTW ther'e might have been some confusing to the original message from John
and the interuption from me who's name's also john. I'm sorry, I'll check
the name next time ...
John Kanding <[EMAIL PROTECTED]> wrote:
> has anyone a good method as to change the property of a property
> list, like in [#john:100, #kurt:200]
> Now change #john to #Bill
Hi John,
-- In the Message window
x = [#john:100, #kurt:200]
SetPropAt(x, 1, #Bill)
put x
-- [#Bill: 100, #kurt: 200]
-- Movie Script
on SetPropAt(propertyList, index, propertyName)
propertyValue = propertyList[index]
propertyList.deleteAt(index)
AddProp_At(propertyList, index, propertyName, propertyValue)
end SetPropAt
on AddProp_At(propertyList, index, propertyName, propertyValue)
tempList = duplicate(propertyList)
propertyList.deleteAll()
itemCount = tempList.count()
repeat with i = 1 to itemCount
if i = index then
propertyList.addProp(propertyName, propertyValue)
end if
propertyList.addProp(tempList.getPropAt(i), tempList[i])
end repeat
return propertyList -- Unnecessary but nice
end AddProp_At
Cheers,
James
[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!]