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

Re: loops [naming variables]


  • Subject: Re: loops [naming variables]
  • From: Emmanuel <email@hidden>
  • Date: Sat, 16 Feb 2002 15:55:10 +0100

At 2:56 AM +0100 16/2/02, has wrote:

> repeat with eachVegetable in the vegetableBasket

The problem is, a given variable won't keep the same status in successive
lines. (actually, this is the very spirit of programmation: you apply
routines intended for "a" thing to "your" thing). One should then write:


repeat with eachVegetable in thevegetableBasket
copy eachVegetable to theCandidateVegetable
if theCandidateVegetable blah blah the
copy theCandidateVegetable to theNewSelectedVegetable
set end of theSelectedBasked to theNewSelectedVegetable
else
copy theCandidateVegetable to theNoGoodFood
-- whoever you are, whatever you do, never try this at home
delete item theNoGoodFood from thevegetableBasket
end
end

Emmanuel

PS
"delete item anItem from aList" is a new feature in AppleScript 2.0.0

(and the h__l with NDA)
_______________________________________________
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.

References: 
 >Re: loops [naming variables] (From: has <email@hidden>)

  • Prev by Date: Re: Initializing?
  • Next by Date: Re: Initializing?
  • Previous by thread: Re: loops [naming variables]
  • Next by thread: Re: loops [naming variables]
  • Index(es):
    • Date
    • Thread