Re: Delete an item in a list ?
Re: Delete an item in a list ?
- Subject: Re: Delete an item in a list ?
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 12 Nov 2004 08:33:26 -0800
On 11/12/04 7:57 AM, "Emmanuel" <email@hidden> wrote:
> At 10:51 AM -0500 11/12/04, Bill White wrote:
>>
>> On 11/12/04 10:37 AM, Studio G sarl <email@hidden> wrote:
>>
>>> May be it's very easy, but can someone tell me how to delete an item in a
>>> list ?
>>
>> Without a scripting addition, you'll have to dig through the list manually.
>
> While with a scripting addition it's just one line.
>
> set ma_liste to {"un", "deux", "trois", "quatre"}
> set ma_liste to suppress item 2 from ma_liste
> return length of ma_liste
> -- 3
>
> (Requires Satimage osax, the free and cool osax by Satimage-software,
> the kind French people of Smile)
That's excellent, Emmanuel. Actually, it's better than the dictionary says:
the dictionary says the result will be a record, when in fact it's list or
record (whatever it started out as), in this case - a list. That certainly
saves all the silly mucking around all the first/middle/last cases every
time. It's absurd that the AppleScript language itself doesn't provide
something similar. Thanks for coming to the rescue once again.
I tried yesterday to provide an answer to someone else here ("Creating a
list of integers from a range") using your createarray, but I couldn't get
it to work.
set rangeList to createarray 6 range {5.0, 10.0} as list of real
I was hoping the result would be {5.0, 6.0, 7.0, 8.0, 9.0, 10.0} but instead
it's:
--> «data
Lido4E6F742061207265636F72642020202040A0000040C0000040E000004100000041100000
41200000»
I figure I must have misunderstood something. The dictionary says
createarray: create an array of real (defined in: Satimage.osax)
createarray integer -- the requested size of the array
[range list of real] -- {min,max}
Result: array of real
Class array of real: a packed list of small real. Can be coerced to an
AppleScript list with "as list of real". Conversely, a list of real may be
translated using "as array of real" for fast computation.
Do I need to upgrade? I'm still in 2.5.9 (for reasons of making
"old-fashioned" compiled scripts in Smile so I can save properties in
"old-fashioned" script menus.)
--
Paul Berkowitz
_______________________________________________
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