Re: Match 'if' Condition and Do Nothing
Re: Match 'if' Condition and Do Nothing
- Subject: Re: Match 'if' Condition and Do Nothing
- From: Jeffrey Mattox <email@hidden>
- Date: Sun, 21 Dec 2003 01:13:12 -0600
Your method will work fine, but you probably aren't saving much time
(unless your conditionals are more complex than your example). If
you simply tested for the two conditions that do have some work
associated, you'd only suffer two tests for the most likely condition
and require one less test for the conditions that do have work.
You could simply comment the fact that the most likely condition is
not tested to make it obvious to later readers.
Jeff
At 11:41 AM -0700 12/20/03, Marconi wrote:
In an 'if' statement, I want to check for one of three conditions.
To keep things efficient I want to check in order from the most
likely condition to the least likely condition. If the most likely
condition is present, I want to do nothing. Only the other two
conditions require action. Is the following the correct syntax for
this?
if theCondition is MostLikely then -- do nothing but
exit the 'if'
else if theCondition is LessLikely then
Do some stuff
else if theCondition is LeastLikely then
do some different stuff
end if
Is this the correct syntax -- just follow 'then' on the first line
with 'else if' on the next?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.