[ANN] HOOT: Hacked Object Oriented Transcript

Dick Kriesel dick.kriesel at mail.com
Mon Feb 27 23:47:43 EST 2006


On 2/27/06 6:02 PM, "wouter" <wouter.abraham at scarlet.be> wrote:

> Rugged id's are a good idea but this handler will not do the trick.
> And it is difficult to deduce from this handler from where to where
> or which parts of the long id is what you call the rugged id.

For a stack, the rugged id is the long id.
For a card, the rugged id is the abbr id.
For an unplaced group, the rugged id is the abbr id.
For a control on a card, the rugged id is the concatenation of the abbr id
and the card id.

Here's a simpler and more robust handler:

getProp uRuggedID
  if word 1 of the target is "stack" then
    put the long id of the target into tRuggedID
  else
    put abbr id of the target into tRuggedID
    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

Thanks again, Wouter.

-- Dick





More information about the use-livecode mailing list