• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: loops vs no loops ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loops vs no loops ?


  • Subject: Re: loops vs no loops ?
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Sat, 4 Nov 2017 23:11:38 +0900

> On Nov 4, 2017, at 22:37, Steve Bird <email@hidden> wrote:
>
>>
>> On Nov 4, 2017, at 9:31 AM, Jean-Christophe Helary
>> <email@hidden> wrote:
>>
>> It's probably a detail but I'm curious.
>>
>> What is the best between (pseudo code):
>>
>> if true
>>      do action 1 to 4
>> else
>>      do action 4
>> end if
>>
>> and
>>
>> if true
>>      do action 1 to 3
>> end if
>> do action 4
>>
>
> If action 4 is long and complicated, then:
> — you have to type it twice, raising the issue of a mismatch.
> — If you decide to change it, you have to change it TWICE.
>
> I would always choose option B.

The actions are indexed so it's really just a matter of running an index from 1
to 4 in the first case and from 1 to 3 in the second + always "running" index 4.

In the case at hand, the action is "set item i of listL to ..."

For some reason, option B looks more pragmatic: always do this action and if
it's necessary do the others...



Jean-Christophe Helary
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com


 _______________________________________________
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

References: 
 >loops vs no loops ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: loops vs no loops ? (From: Steve Bird <email@hidden>)

  • Prev by Date: Re: loops vs no loops ?
  • Next by Date: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
  • Previous by thread: Re: loops vs no loops ?
  • Next by thread: No effect when I click with UI scripting on the sidebar of "Open..." navigation window
  • Index(es):
    • Date
    • Thread