Function to break apart a Long Name?

Cubist at aol.com Cubist at aol.com
Tue Oct 18 22:59:26 EDT 2005


sez revolution at jaedworks.com:
>At 4:00 PM +0100 10/17/2005, David Burgun wrote:
>>Does anyone know of a function that will extract name of the 
>>Control, Group, Card and Stack from a long name string?
>>e.g. I have a string of the form:
>>control "A" of group "B" of card "C" of stack "D"
>>And I would like to have:
>>
>>local myControlName  = A
>>local myGroupName = B
>>local myCardName = C
>>local myStackName = D
>
>I'd use the short name in conjunction with the owner for this:
>
>   -- "myControl" is control "A" of group "B" of card "C" of stack "D"
>   put the short name of myControl into myControlName
>   put the short name of the owner of myControl into myGroupName
>   put the short name of the owner of the owner of myControl into myCardName
>   put the short name of the owner of the owner of the owner of 
>myControl into myStackName
   Problem: If you use this on something that *isn't* in a group, myGroupName 
will end up being the name of a card; myCardName will be the stack name; and 
I'm not sure *what* myStackName will end up as. Also, what happens to the long 
name of a control that lives in a *substack*?



More information about the use-livecode mailing list