Parsing the long ID or long Name

Alex Tweedly alex at tweedly.net
Tue Jul 26 19:53:11 EDT 2016


Not sure I understand the real problem - or why array could help - but 
one observation ...


On 26/07/2016 23:47, Sannyasin Brahmanathaswami wrote:
> Trying to avoid reinventing the wheel here:
> ...
> The obvious param to send to the behavior is the long ID or long Name of the target, or the owner of the target… or the owner of the owner of the target…
>
> image "portal-link-image" of group "listen_music" of group "listen-links" of card "listen-links" of stack "/Users/Brahmanathaswami/Documents/App-Development/SivaSivaAppWorking/_SivaSource/source/modules/listen/listen.livecode"
>
> in this specific use case.. we the sub-info-param the behavior needs to act is "listen-music"
>
> I'm curious if anyone has written a generic parser for turning the long ID or long Name of the target into an array?  I suppose some hacky trick like turning the word "of" into "|"  or tab and then splitting the string.. but I can't figure out how to split
>
> image "someQuotedObjectName
>
> otherwise resort to old parsers like
>
> word 2 of the long name of the owner of the target…
> but this too is iffy because we can't assume that every name is a word.. the quoted string could have spaces…
This isn't iffy.  A quoted string is a single word - even if it contains 
spaces. Note that the word *does* contain the enclosing quotes, so you 
might want
    char 2 to -2 of word 2 of the long anme of the owner of the target

-- Alex.




More information about the use-livecode mailing list