Function to break apart a Long Name?
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Mon Oct 17 11:50:39 EDT 2005
Hi Dave,
function ObjectsList pLongName
replace space & "of" & space with comma in pLongName
return pLongName
end ObjectsList
Then you get a comma delimited list of all objects:
From 'button "Button" of group "group" of card "card" of stack
"Untitled 1"'
you get 'button "Button",group "group",card "card",stack "Untitled 1"'
As for extracting only the names from the above list, using something
like value(word 2 to -1 of item x of tList) will do the trick :-)
Hope this helps.
Best Regards from Paris,
Eric Chatonet.
Le 17 oct. 05 à 17:00, David Burgun a écrit :
> 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
>
> Any tips of how to write some code to do this would be greatly
> appreciated if there is not a standard function available.
>
> I haven't used the string function in RunRev much and I'm having
> difficulty in working out the best way to do this.
>
> Thanks a lot
> All the Best
> Dave
----------------------------------------------------------------
So Smart Software
For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
Free plugins and tutorials on my website
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email eric.chatonet at sosmartsoftware.com/
Phone 33 (0)1 43 31 77 62
Mobile 33 (0)6 20 74 50 86
----------------------------------------------------------------
More information about the use-livecode
mailing list