Re: Copy to list Question
Re: Copy to list Question
- Subject: Re: Copy to list Question
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 15 Apr 2009 18:45:43 -0400
So you want to have a list of indeterminate size. I still don't know
why you don't just use a list in the first place. What do the
intervening variables get you?
If you want different parts of the code to selectively add to the
list, they can just do
set end of ListAnimals to "Cat"
...
set end of ListAnimals to "Horse"
...
etc. If you want to add strings only if they're not empty, maybe a
handler is the solution:
property ListAnimals : {}
on maybeAdd(animalName)
if animalName is not "" then
set end of ListAnimals to animalName
end if
end maybeAdd
maybeAdd("Cat")
maybeAdd("Dog")
maybeAdd("")
maybeAdd("Bird")
ListAnimals -- returns {"Cat", "Dog", "Bird"}
_______________________________________________
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