short name broken?

Peter Bogdanoff bogdanoff at me.com
Tue Nov 1 14:32:33 EDT 2016


On a somewhat related note, I filed this bug yesterday:

Property Inspector doesn't retain new control name when clicking properties checkboxes
http://quality.livecode.com/show_bug.cgi?id=18740


Peter Bogdanoff



On Nov 1, 2016, at 11:12 AM, Richard Gaskin <ambassador at fourthworld.com> wrote:

> dunbarx wrote:
> 
> 
> > Richard wroteL
> >> In v9 try:
> >>
> >> 1. Create a new field
> >. 2. In the Message Box, run:
> >>
> >>    put the short name of last field
> >>
> >> I get the name instead, e.g. "field id 1009".
> >>
> >> IIRC the short name of a field is empty until you set it.  When a
> >> field is unnamed, "the short name" returns empty and "the name"
> >> would return the form shown above, yes?
> >>
> >> Otherwise, we have no way to know when a field has not yet been
> >> named.
> >
> > If I make a new control, and immediately ask for its name, or short
> > name, I have always gotten the default name in the inspector, which
> > is something like:
> >
> > field "field"
> > or
> > button "button".
> 
> Exactly.  The form has changed.
> 
> This is at least progress, since the older IDE habit of forcing redudant-form names was always confusing and needed to go, leading us to less-than-graceful coding like:
> 
>  put field "field 1" into field 1
> 
> This was made super-awkward since ordinal references are a very specific thing in xTalks, and the force-applied name used an ordinal form that will bear no relationship to its actual ordinal reference the moment its layer changes.
> 
> So good riddance on that - kudos to the team for finally taking care of that.
> 
> But here we get to a condundrum:
> 
> > Never empty.
> 
> You're absolutely right.  When in doubt I check the Winkler-Kamins-DeVoto reference, and indeed they verify that all name queries will return a value, even when the property itself is empty. When using "the short name" on an unnamed object, WKD says it should return the ID form, as LC currently does.
> 
> I can appreciate the hand-holding of ensuring that name queries always return a meaningful value, it does raise a question:  is it possible to know if the name property of an object is empty?
> 
> For example, if I wrote a script similar to the older IDE script that insisted on setting the name property to a value that resembles what we get with unnamed objects, how could we know the object's name us truly empty?
> 
> In a pre-coffee moment I had mistakenly believe that the short name might allow this, but I'm not disappointed to find that LC now follows the tradition of the mother tongue.
> 
> I suppose if I ever find myself needing to know that I could do this:
> 
> function HasNoName pObj
>  put the properties of pObj into tA
>  return (tA["name"] is empty)
> end HasNoName
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> 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