Dictionary error regarding TemplateObject

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Dictionary error regarding TemplateObject

Post by dunbarx » Mon Sep 22, 2014 3:05 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Dictionary error regarding TemplateObject

Post by FourthWorld » Mon Sep 22, 2014 3:38 am

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Dictionary error regarding TemplateObject

Post by dunbarx » Mon Sep 22, 2014 6:26 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Dictionary error regarding TemplateObject

Post by FourthWorld » Mon Sep 22, 2014 6:42 am

The bug reporting DB has a category for documentation errors.
http://quality.runrev.com/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Dictionary error regarding TemplateObject

Post by dunbarx » Mon Sep 22, 2014 2:52 pm

Richard.

Reported.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Dictionary error regarding TemplateObject

Post by FourthWorld » Mon Sep 22, 2014 5:28 pm

Thanks for filing that, Craig. What's the bug report number?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Dictionary error regarding TemplateObject

Post by dunbarx » Mon Sep 22, 2014 6:28 pm

Richard.

Confirmed (no surprise). # 13506.

Craig

Post Reply