Re: Determining item number matching "x" in a list
Re: Determining item number matching "x" in a list
- Subject: Re: Determining item number matching "x" in a list
- From: John Delacour <email@hidden>
- Date: Sat, 15 Mar 2003 13:10:09 +0000
- Mac-eudora-version: 6.0a11
At 2:51 am +0000 15/3/03, Nigel Garvey wrote:
Well. After all the discussion, I just had to compare the two myself on
my own Pismo 400MHz. Necessarily, this was in 9.2.2 in order to use 'the
ticks'. (The handlers themselves aren't shown shown in this test code)...
You can use GetMilliSec or Jon's Commands.osax in OS 10
I said I'd give the MacPerl version of the method I proposed, and
here it is. It takes about 15 ticks to get the indices of x in a
list of 10,000 items.
I really don't see the point of messing about with straight
AppleScript when we have had perl as a resource on the Mac for years.
MacPerl can just sit in the background as a resource and do just what
perl does in OS 10. I can euqally well use MacPerl in Classic as
perl.
tell app "MacPerl"
set listCount to 10000
set f to (path to temporary items as string) & "junk.txt"
set t to the ticks
set output to Do Script "
open F, qq~>" & f & "~ or die $!;
for (1.." & listCount & ") {
$_ = 33 + int rand(222) ; print F chr() .$/}
open F, qq~" & f & "~;
for (<F>) {
$i++ ;
/a/ and print qq~$i$/~ }" mode Batch
end
{"" & ((the ticks) - t) & " ticks
", output}
_______________________________________________
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.