Re: Things I thought I knew, but didn't - variable scope in repeat loops
Re: Things I thought I knew, but didn't - variable scope in repeat loops
- Subject: Re: Things I thought I knew, but didn't - variable scope in repeat loops
- From: Skeeve <email@hidden>
- Date: Fri, 26 Dec 2008 17:53:16 +0100
has schrieb:
If loop variables were scoped only to the repeat block, the final
'log' command would give 'hello', not 3.
HTH
Partly. Explain this:
set x to "hello" -- binds 'x'
log x --> "hello"
repeat with x from 1 to 3 -- rebinds 'x'
log x --> 1, 2, 3
repeat with x from 10 to 30 by 10 -- rebinds 'x'
log x --> 10, 20, 30
end repeat
end repeat
log x --> 30
_______________________________________________
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