Page 1 of 1

Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 3:05 am
by dunbarx
The dictionary states, in the section on the "create" command:
Note: In the development environment, after an object is created, LiveCode automatically resets the corresponding template to its default values. This means that if you change an objecttemplate and then create several objects of that type, only the first object will reflect your settings. To prevent LiveCode from automatically setting the template back to its defaults, set the lockMessages property to true before creating the objects:
This is not so. Create two buttons. In the first, place this into its script:

Code: Select all

on mouseUp
   set the properties of the templateButton to the properties of btn 2
   create btn "xx"
end mouseUp
Successive clicks on button 1 will create multiple copies of btn 2, all named "xx" and all overlying btn 2. Am I misreading the intent of the caveat to lock messages or the template button will be reset to defaults? It would seem this is a terrible waste of a fabulous feature. Once a template is set, it ought to persist throughout the current session, at the least. The good news is that it does not matter if I lock messages or not, so I am really asking if this paragraph is just bogus. Nothing of this sort is mentioned in the dictionary entries about the templates themselves, only in the "create" command entry.

Craig Newman

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 3:38 am
by FourthWorld
Good catch. Maybe it worked as described once in a time, but as long as I've used template objects they remain persistent throughout the session, giving rise to the reset commands to restore engine defaults.

Have you filed a big report on this yet?

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 6:26 am
by dunbarx
Richard.

OK, I thought so. I have used the various templateWhatevers forever, and never even thought about the fact that they might revert after one use. It was only while responding to a query in this forum that I happened upon that warning.

But I cannot say it is a bug. Rather it is a matter of simply deleting that paragraph in the dictionary, and all will be right with the world. Who do I exhort to do that? QC?

Craig

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 6:42 am
by FourthWorld
The bug reporting DB has a category for documentation errors.
http://quality.runrev.com/

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 2:52 pm
by dunbarx
Richard.

Reported.

Craig

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 5:28 pm
by FourthWorld
Thanks for filing that, Craig. What's the bug report number?

Re: Dictionary error regarding TemplateObject

Posted: Mon Sep 22, 2014 6:28 pm
by dunbarx
Richard.

Confirmed (no surprise). # 13506.

Craig