Re: Can someone explain this?
Re: Can someone explain this?
- Subject: Re: Can someone explain this?
- From: Sun Real <email@hidden>
- Date: Mon, 18 Dec 2000 10:01:23 +1100
On Sun, 17 Dec 2000 11:10:42 -0800, Paul Berkowitz <email@hidden>
wrote:
>
...So I think what's happening here is that
>
AS is understanding this as a so
>
>
Set2be [unknown event] to [boolean parameter of the event] true
>
>
compiling to:
>
>
Set2be [unknown event] with to
>
>
which, as you say, errors in execution. Interestingly, it says "<<script>>
>
doesn't understand the Set2be message" rather than "undefined variable", so
>
I think that shows it thinks that 'Set2be' is supposed to be an event, not a
>
variable, due to the boolean parameter syntax.
>
>
Anyone?
Testing here suggests that 'Set2be' is compiling as a positional
parameter sub-routine call with just a boolean parameter:
Set2be with to
set not2be to false
to Set2be with to
beep
end Set2be
This runs here. I don't know why the compiler allows the keyword 'to' to
be passed as a boolean param (it didn't appear to be possible to use it),
but if a non-reserved word is used, it becomes a switch:
Set2be with too
set not2be to false
to Set2be with too
if too then
beep
else
beep 2
end if
end Set2be
Then again, I've also noticed '... with to' and '... without to' showing
as events in the Event Log of Script Editor when I'm setting booleans in
a Dialog Director dialog. For example, I write:
dd set enabled of item 26 of dLog to false
And the event log shows:
dd set enabled of item 26 of dialog id 1 without to
So perhaps it's an alternative way of specifying a single boolean param.
Anyone else?
Cheers,
Richard Morton
-- Great Lies of the Music Business: "The booking is definite"