[TAO] value() to obtain pointer functionality

hh hh at livecode.org
Sun Aug 3 07:29:21 EDT 2014


Hi Peter and all,

(please have in mind, that I'm not a native speaker and am 18 months with LC. So the following will be a bit 'bumpy'. I write just as I understand it, no arrogance intended with my phrasing and wording.)

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".

Now recall also that the keyword "the" is optional before the names of properties.

> 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

Besides other working examples given by you and others this works (with or without "the") too, e.g.:

do "set the" && ("na"&"me") && "of btn" && quote&"xyz"&quote && "to 10"

because "do" removes the offending token "(" and ")" [and also, what's next, the offending double quotes].

That's very useful. Consequently LC is in this case wrong with setting "(do is useful)" to false.

Hermann

p.s. Also this cannot work (too with "tName", ...):
set the "name" of btn "xyz" to 10
set "name" of btn "xyz" to 10

The latter one does nothing and gives no error, but it should, the quotes are 'offending' token separators. Call it a "bug"?

Would be nice if Mark Wieder came in (?) and correct me where I'm wrong.





More information about the use-livecode mailing list