Re: How to do a goto with Applescript?
Re: How to do a goto with Applescript?
- Subject: Re: How to do a goto with Applescript?
- From: Skeeve <email@hidden>
- Date: Sun, 02 Jan 2011 21:35:15 +0100
I often use GOTO (in languages which have it) to jump to the end of a
long list.
Often it's really helpful to avoid longish, deep nested if then elsif
"trees"
In Applescript I usually do it eiteher in a subroutine:
on decision(x)
if x=1 then
do something
return
end if
if x=2 then
do something
return
end if
end decision
Or I use a loop:
repeat
if x=1 then
do something
exit repeat
end if
if x=2 then
do something
exit repeat
end if
exit repeat
end repeat
_______________________________________________
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