Naming Custom Properties

Vokey, John vokey at uleth.ca
Fri Apr 16 19:39:56 EDT 2010


If you note in the Dictionary there is a comment from me on this ``hiccup'' of the custom properties, and it represents a long-standing complaint of mine (i.e., that all custom property names should be quoted literals or the contents of some variable).  The problem is this:

if variable fred has not been defined, then 

  set the fred of this stack to myArray

will, of course create the custom property "fred" with the contents of myArray.  However, if fred has the contents "mary" then the same line

  set the fred of this stack to myArray

will create the custom property "mary" with the contents of myArray. And this latter syntax is very convenient for creating custom properties with custom names on the fly.  However, to be consistent, the name of the custom property should be a quoted literal when not the contents of a variable name, such that the lines:

  set the "fred" of this stack to myArray
  put "fred" into mary; set the mary of this stack to myArray

do the same thing.  The line

  set the fred of this stack to myArray

should throw an error if fred is empty.  Unfortunately, nobody at RunRev seems to agree with my desire for a consistent syntax.


On 2010-04-16, at 4:51 PM, use-revolution-request at lists.runrev.com wrote:

> Hello everyone,
> 
> I vaguely, very vaguely, recall that a custom property should have a name that is different from the variable to which it is being set.  So, for example, if myArray is the variable, then
> 
> 	set the myPropArray of this stack to myArray
> 
> is fine, but
> 
> 	set the myArray of this stack to myArray
> 
> does not set anything apparently.  I waisted a big chunk (no xTalk pun intended) of time rediscovering that, and I'd just like to confirm that that is the case.  I'm also wondering whether anyone can point me to where this convention is discussed in the Users Guide or built-in dictionary.
> 
> Regards,
> 
> 	Gregory

--
Please avoid sending me Word or PowerPoint attachments.
See <http://www.gnu.org/philosophy/no-word-attachments.html>







More information about the Use-livecode mailing list