Re: Arrays in AppleScript ?
Re: Arrays in AppleScript ?
- Subject: Re: Arrays in AppleScript ?
- From: Mr Tea <email@hidden>
- Date: Thu, 29 Dec 2005 18:07:21 +0000
This from has - dated 28/12/05 22.05:
>> What's a lot trickier in AppleScript than in some other languages is to
>> insert a new element somewhere in the middle.
>
> Not so much tricky as impossible
set mylist to {}
set int to 1
repeat 10 times
set end of mylist to int
set int to int + 1
end repeat
set listinsert to 7.5
set end of mylist to 0
set listcount to count mylist
repeat 3 times
set item listcount of mylist to item (listcount - 1) of mylist
set listcount to listcount - 1
end repeat
set item listcount of mylist to listinsert
mylist --> {1, 2, 3, 4, 5, 6, 7, 7.5, 8, 9, 10}
:-)
Nick
pp Mr Tea
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden