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

Reply via email to