Sorry for John (Erazo) for overlooking the need to avoid case sensitivity.
You already have a great solution.



This handler can modify a input property if it find one and assign a new
property and value (if new value provided).

Hope it's hopeful.

on modifyProp pList, oldProp, newProp, propValue
  if not ilk(pList, #propList) then exit
  if voidP(oldProp) or voidP(newProp) then exit
  if voidP(pList[oldProp]) then exit
  if voidP(propValue) then propValue = pList[oldProp]
  pList.deleteProp(oldProp)
  pList[newProp] = propValue
end

Thomas YEH







on 12/13/00 2:07 PM, John Kanding at [EMAIL PROTECTED] wrote:

> BTW 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
> 
> John
> 
>> -----Oprindelig meddelelse-----
>> Fra: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]]På vegne
>> af John Erazo
>> Sendt: 13. december 2000 13:59
>> Til: [EMAIL PROTECTED]
>> Emne: Re: <lingo-l> Help with Lists
>> 
>> 
>> From: "Thomas Yeh" <[EMAIL PROTECTED]>
>> 
>>> So maybe instead of stepping through the list ourseleves,
> 
>> we can just let
>>> the underlying C or Assembly code does it for us, as in
>> following handler.
>>> 
>>> on addItem theList, theItem
>>> if not ilk(theList, #linearList) then exit
>>> itemPos = theList.getPos(theItem)
>>> if itemPos then return itemPos
>>> theList.add(theItem)
>>> return theList.getPos(theItem)
>>> end
>> 
>> Thank you,  Thomas.
>> 
>> Yes. You are right when you said that it is case sensitive
>> as in the following example...
>> 
>> -- Welcome to Director --
>> put gList
>> -- ["Earth", "Jupiter", "Mars", "Venus", "Saturn"]
>> 
>> put getPos(gList, "Earth")
>> -- 1
>> 
>> put getPos(gList, "EARTH")
>> -- 0
>> 
>> put getPos(gList, "earth")
>> -- 0
>> 
>> -- Your script at work.
>> addItem(gList, "earth")
>> 
>> put gList
>> -- ["Earth", "Jupiter", "Mars", "Venus", "Saturn", "earth"]
>> 
>> addItem(gList, "EARTH")
>> 
>> put gList
>> -- ["Earth", "Jupiter", "Mars", "Venus", "Saturn", "earth", "EARTH"]
>> 
>> 
>> Maybe going through each item on the list is till the safest one.
>> 
>> Thanks again for your help.
>> 
>> 
>> John Erazo
>> 
>> 
>> 
>> [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!]
> 


[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