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: Robert Poland <email@hidden>
- Date: Sun, 2 Jan 2011 11:39:48 -0700
Mark,
André and Michelle gave a good answers to my question.
Since when is the following not real code?
if (x = 1) then
set y to 1
else if (x = 2) then
set y to 2
end if
display dialog "x is = to " & y
On Jan 2, 2011, at 10:42 AM, Mark J. Reed wrote:
I recommend Dijkstra's famous letter/rant "Goto statement considered
harmful" (http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF).
Programming was very different in 1968, but the basic premise still
holds; structured programming is the way to go. If you posted real
code instead of a generic example, we might be able to suggest the
best approach for your particular use case.
On Sunday, January 2, 2011, Michelle Steiner <email@hidden> wrote:
> On Jan 2, 2011, at 7:39 AM, Robert Poland wrote:
>
>> Thanks André and Michelle,
>>
>> I guess that's sort of what what I was doing, just thought there might be a better way.
>
> Actually, this is the better way. GOTO leads to spaghetti code which can become hard to troubleshoot.
>
> Also GOTO requires line numbers and/or line labels, and Applescript has neither.
>
> -- Michelle
>
> --
> Windows Vista: Viruses, Intrusions, Spyware, Trojans, and Adware.
>
>
> _______________________________________________
> 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
>
--
Mark J. Reed <email@hidden>
_______________________________________________
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
Robert Poland - Fort Collins, CO
_______________________________________________
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