inheriting any custom property

Dick Kriesel dick.kriesel at mail.com
Fri Sep 23 18:03:20 EDT 2005


Here¹s a function that (I think) lets any object inherit any custom
property.  It works for me, but does anyone see trouble with it?

function effectiveValue pPropertyName
  put the long id of the target into tObject
  put "put the" && pPropertyName && "of tObject into tValue" into tStatement
  lock messages
  repeat until tObject is empty
    do tStatement
    if tValue is not empty then exit repeat
    if word 1 of tObject is "stack" then delete word 1 to 3 of tObject
    else delete word 1 to 4 of tObject
  end repeat
  unlock messages
  return tValue
end effectiveValue

As an example application, here's a getProp handler for uSampleProperty:

getProp uSampleProperty
  return effectiveValue(param(0))
end uSampleProperty

Thanks in advance for your consideration...

-- Dick





More information about the use-livecode mailing list