Function to break apart a Long Name?

Ken Ray kray at sonsothunder.com
Mon Oct 17 16:34:59 EDT 2005


On 10/17/05 10:00 AM, "David Burgun" <dburgun at dsl.pipex.com> wrote:

> Hi,
> 
> 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

here you go: (1 line, watch for line wraps)

-- tControl is the long name of the control as you've shown above
-- adjust to suit

get matchText(tControl,"control \"(.*?)\" of group \"(.*?)\" of card
\"(.*?)\" of stack 
\"(.*?)\"",myControlName,myGroupName,myCardName,myStackName)


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list