• 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
Avoiding repetition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoiding repetition


  • Subject: Avoiding repetition
  • From: Bernard Azancot <email@hidden>
  • Date: Thu, 15 Jul 2004 21:14:43 +0200

Still another basic newbie question:

The following script has no problem. I just would like to know if it is possible to improve its "coding style" .


(* Pseudo Script Start *)

-- Note that "action" is the action performed, always the same (delete/copy), but in a different folder each different day of the week (backup purpose)

If myday = Monday then
action to folder A

else If myday = Tuesday then
action to folder B
...
...
else if myday = Sunday then
action to folder G

(* Pseudo Script End *)



Is there a way to avoid repeating 7 times the same boring code lines with 2 bound variables (day and folder) ?

Thanks in advance.
BA
_______________________________________________
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.


  • Follow-Ups:
    • Re: Avoiding repetition
      • From: Axel Luttgens <email@hidden>
    • Re: Avoiding repetition
      • From: Michelle Steiner <email@hidden>
    • Re: Avoiding repetition
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Filemaker
  • Next by Date: Re: Filemaker
  • Previous by thread: Quark 4.11 Get Page Question
  • Next by thread: Re: Avoiding repetition
  • Index(es):
    • Date
    • Thread