Missing properties

Mike Bonner bonnmike at gmail.com
Sun Dec 7 19:08:03 EST 2014


There is the exception of a substack which would have 2 stack entries, but
not really much of an issue.

Adding 2 getprop handlers to the message path implements the desired
behavior pretty easily. (mainstack preferrably, or of course a library or
inserted script)

The following 2 getprops work well enough, though they may break of an
object includes " of " in the name.  Didn't test it with  an actual stack,
substack setup, but pretty sure its right as far as it goes.

And yeah, I know everyone knows this already but it was a chance to mess
with getprop which I've seldom used before. :)
getprop owningcard
   put the long name of the target into tTarget
   replace " of " with cr in tTarget
   if line -2 of tTarget contains "card" then
      return line -2 of tTarget
   else
      return line -3 of tTarget
      end if
end owningcard

getprop owningstack
   put the long name of the target into tTarget
   replace " of " with cr in tTarget
   if line -2 of tTarget contains "stack" then
      return line -2 of tTarget
   else
      return line -1 of tTarget
   end if
end owningstack


It would also be cool if the name of a group actually was.  New group names
are empty (cards too) so they are displayed differently than other objects
when looking at the long name.  They're returned without surrounding quotes
unless of course you click in the property inspector name box and then
click away (keeping the display name that wasn't a name, that is then a
name.. Say that 3 times fast)  Would make it easier to chunk up a long name
if it were consistent since  " " strings (with preceding and trailing
space?) are treated as words.

On Sat, Dec 6, 2014 at 9:50 PM, <dunbarx at aol.com> wrote:

> Pete.
>
>
> What Mike said, in that maybe I do not understand your question. A control
> might, for example, belong to one or more groups, and a different control
> might belong to yet another group.
>
>
> But there is only one card that they all reside on, and only one stack
> that they, er, reside in. But if there is indeed only one of each, then the
> "owner" is just that, the card and the stack.
>
>
> Craig
>
>
>
> -----Original Message-----
> From: Mike Bonner <bonnmike at gmail.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Sent: Sat, Dec 6, 2014 11:17 pm
> Subject: Re: Missing properties
>
>
> Seems like "this card" would be useful, or, you could just get the long
> name of the object which contains a small to big list of owning objects
> starting with the object itself.
>
> On Sat, Dec 6, 2014 at 6:03 PM, Peter Haworth <pete at lcsql.com> wrote:
>
> > Every now and again, I wonder why certain properties are not available in
> > LC.  The ones that puzzles me the most are the owning card and owning
> stack
> > of an object.
> >
> > Maybe it's just the kind of tools I write but I frequently need to get
> that
> > information.
> >
> > I have written a couple of handlers to get that information but it just
> > seems like there should be a property that does it for you, maybe
> > "ownerStack" and "ownerCard".
> >
> > I've tried a couple of different ways of getting that information and
> > curious how other people do it.  I'm sure there are a lot of people who
> > have written the same handlers!
> >
> > I have a recursive function that traverses up the chain of owner
> properties
> > until it gets to a card or stack, and another one that parses the long
> name
> > of a control to get the information.  I think I prefer the recursive
> > function
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> > Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> > SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list