Function for returning a list of objects on a card

Bob Sneidar bobsneidar at iotecdigital.com
Fri Jan 5 12:56:27 EST 2018


Here is a workaround. Replace the getObjectProps function with the following function. I suspect there are other properties that will return empty instead of what they should. Apparently the long id will return empty too:

on getObjectProps pControl, pControlName, pIndex, pPropList, @aObjectData
   repeat for each item tProp in pPropList
      put pControlName into aObjectData [pIndex] ["controlname"]

      if tProp is "long id" then
         put pControl into aObjectData [pIndex] [tProp]
      else if tProp is "owner" then
         set wholeMatches to true
         put wordOffset("of", pControl) into tFoundWord
         if tFoundWord = 0 then
            put empty into aObjectData [pIndex] [tProp]
         else
            put word tFoundWord +1 to -1 of pControl into tOwnerID
            put the name of tOwnerID into aObjectData [pIndex] [tProp]
         end if
      else
         put the tProp of pControl into aObjectData [pIndex] [tProp]
      end if
   end repeat
end getObjectProps

> On Jan 5, 2018, at 09:10 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi all. 
> 
> I put together a couple of handlers that will return all the objects on a card in the form of an array whose elements are the objects names as a return delimited list, the Long IDs as a return delimited list and an array of the properties of each object which properties are passed in a parameter. The syntax is:
> 
> put getCardObjects(pCardID, "rect,visible,owner") into aCardObjects





More information about the use-livecode mailing list