Mystery with arrays (lost key)
Robert Brenstein
rjb at rz.uni-potsdam.de
Mon Apr 15 09:11:00 EDT 2002
on 10/4/02 9:18 AM, Robert Brenstein at rjb at rz.uni-potsdam.de wrote:
> > As far as I know, the use of non-quoted literals comes from HyperTalk
> > and Scott strongly recommends to always quote literals. It is
> > definitely a cleaner way to code and eliminates any ambiguities.
>
>I totally agree (with both you and Scott). But note that currently in
>MetaTalk there is one place where you _can't_ use a quoted literal, namely
>in custom properties.
>
>Eg if a button has the custom property "sourcefile" then this code:
>
> on mouseUp
> answer the sourcefile of me
> end mouseUp
>
>works; but this code:
>
> on mouseUp
> answer the "sourcefile" of me
> end mouseUp
Ben, I am not sure why you want to use quotes here for custom
property names. Those names become part of the xTalk syntax once
defined, so there is no need to quote them. You do not use quotes
when calling your handlers or functions, do you?
>doesn't; and nor does this:
>
> on mouseUp
> put 23 into sourcefile
> answer the sourcefile of me
> end mouseUp
>
>I think this is a bug in the parser, or a hole in the syntax.
Here you define a local variable called "sourcefile" creating a
namespace conflict so do speak. I believe that local var name simply
takes priority so you are effectively asking for "answer the 23 of
me" in the second like and such a property (23) does not exist.
Robert
More information about the metacard
mailing list