Re: Before I forget
Re: Before I forget
- Subject: Re: Before I forget
- From: deivy petrescu <email@hidden>
- Date: Sun, 16 Mar 2008 16:04:18 -0400
On Mar 16, 2008, at 13:19, Axel Luttgens wrote:
Le 15 mars 08 à 23:22, deivy petrescu a écrit :
I am reading the new Guide, and before I forget, I want to call the
attention to some points.
[...]
The other point is the Guide assertion (p 52)
"The value of a variable declared with the copy or set command is
reset each time a script is run."
This is not true!
Check:
___
try
set x to x + 1
on error
set x to 3
end try
---
run it many times without compilation in between.
Hello Deivy,
From page 51: "The declaration of a variable or property identifier
is the first valid occurrence of the identifier in a script object."
In the above, assuming the script has been run at least once, the
first valid occurrence of identifier "x" is the one appearing in the
right-hand side of:
set x to x + 1
Thus, strictly speaking, one isn't considering a variable declared
with the set command anymore, and one could infer the ASLG is right.
Or, at least, not wrong.
Looks like the new ASLG won't be the definitive "Bible"... ;-)
Axel
Hi Axel,
I certainly agree with your last statement. But I am not sure about
your argument before.
On page 53 of the Guide:
"The value of a global variable also persists after the script in
which it is defined has been run."
and the example is almost the same as the one i submitted. So, if it
is good for the goose it is good for the gander ...
Another point, even when using "local" declaration, the variable is
kept on the script. Which is kind of weird considering the example I
posted.
The following
set mypasswd to "bomdia"
will show "bomdia" on your script whether it is declared as local or
not.
That is save the script above and open it in TextEdit. "bomdia" will
be clearly readable.
This differs than what I'd expect using "local".
I still have to read many more pages, and I already have a bunch of
questions.
May be next week...
Deivy _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden