[TAO] value() to obtain pointer functionality

Peter Haworth pete at lcsql.com
Sun Aug 3 13:01:38 EDT 2014


On Sun, Aug 3, 2014 at 4:29 AM, hh <hh at livecode.org> wrote:

> This is a syntax rule: "the" is followed by the name of a property or
> function.
> That's why no parentheses are allowed to follow in the name, else date()
> couldn't be equivalent to "the date".
>

> > Peter H. wrote :
> > Here's the one that catches me every time:
> > set the (<any expression here>) of button "xyz" to 10
>
> In sum all this cannot work:
>
> set ("na" & "me") of btn "xyz" to 10
> set "(na" & "me)" of btn "xyz" to 10
> set the ("na" & "me") of btn "xyz" to 10
> set the "(na" & "me)" of btn "xyz" to 10
> set "the (na" & "me)" of btn "xyz" to 10
>

Herman,
I think you're misunderstanding my point.  The "(" and ")" aren't the
issue.  My point is that LC won't accept any type of expression (other than
a variable name) with or without parentheses as a custom property name.

The first and third examples you gave above should work, with or without
the parentheses.  The presence of "set" and "of" tell the compiler that a
custom property is being referenced and, although I'm certainly not an
expert on parsing, I can't see why the compiler ( or the engine at runtime)
can't evaluate an expression which results in a custom property name before
executing the rest of the command.  That's what happens everywhere else in
LC although sometimes the value() function is required.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>



More information about the use-livecode mailing list