[ANN] HOOT: Hacked Object Oriented Transcript

Dick Kriesel dick.kriesel at mail.com
Tue Feb 28 04:04:56 EST 2006


On 2/28/06 12:41 AM, "Geoff Canyon" <gcanyon at inspiredlogic.com> wrote:

> To handle unplaced groups:
> 
> getProp uRuggedID
>    get the long id of the target
>    if "card" is among the words of it then return (word 1 to 3 of it
> && word -7 to -4 of it)
>    return word 1 to 3 of it
> end uRuggedID
> 
> getProp uRuggedLongID
>    get the long id of the target
>    if "card" is among the words of it then return (word 1 to 3 of it
> && word -7 to -1 of it)
>    return (word 1 to 3 of it && word -3 to -1 of it)
> end uRuggedLongID


That works for unplaced groups but not for cards.

This works for all Rev object types (I think):

getProp uRuggedID
  if word 1 of the target is "stack" then
    put the long id of the target into tRuggedID
  else if (word 1 of the target is "group") \
        and (word 1 of the owner of the target is "stack") then
    put "bkgnd id" && the short id of the owner of the target into tRuggedID
    -- note: "bkgnd" is word 1 of the long id of an unplaced group
  else
    put abbr id of the target into tRuggedID
    put long id of the target into tLongID
    put offset(" of card id ",tLongID) into tOffset
    if tOffset > 0 then
      put char tOffset to tOffset + offset(space,tLongID,tOffset + 12) \
          + 11 of tLongID after tRuggedID
      -- note: 12 is the length of " of card id "
    end if
  end if
  return tRuggedID
end uRuggedID

getProp uRuggedLongID
  put the long id of the target into tLongID
  put the uRuggedID of tLongID into tRuggedLongID
  put offset(" of stack " & quote,tLongID) into tOffset
  put char tOffset to -1 of tLongID after tRuggedLongID
  return tRuggedLongID
end uRuggedLongID


Maybe Geoff will come up with a simpler and/or faster implementation...

-- Dick





More information about the Use-livecode mailing list