[Tip] Propeties & sets & List of 'reserved words' and gotchas

J. Landman Gay jacque at hyperactivesw.com
Mon Feb 20 20:27:09 EST 2006


Stephen Barncard wrote:
> Trevor -
> 
> I've seen references that the brackets are enough to serve as quotes - 
> it works either way for me. That's not the problem.
> 
> Quotes or no quotes - I've found one can't save a custom property with a 
> name of an existing regular PROPERTY in the same object without problems 
> -- unless of course the quotes appear in the name...
> 
> custom props with names like name, title, tabstops, html ,etc. will 
> cause trouble in various ways -
> 
> Try it - won't work in the properties inspector or from script. It will 
> seem to have been entered, but reading back the prop name will display 
> the regular property rather than your custom one...or just nothing.

I just did this:

set the cList["name"] of this stack to "testName"
put the cList["name"] of this stack

And got the expected result. Did I do the test right?

> Not knowing this has caused hours of weirdness, because there is no 
> error reporting on custom prop activity.
> 
> Reserved words aren't part of the properties system, but I've become 
> suspicious of using them. Another reason to use standard naming 
> conventions I guess.

Regardless of the above, you couldn't say a truer thing. Reserved words 
shouldn't be used for variable names.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list