Re: loops [naming variables]
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.