Re: Extracting from text [Lecture]
Re: Extracting from text [Lecture]
- Subject: Re: Extracting from text [Lecture]
- From: Nigel Garvey <email@hidden>
- Date: Fri, 1 Mar 2002 11:16:44 +0000
has wrote on Fri, 1 Mar 2002 00:23:41 +0000:
>
Nigel Garvey wrote:
>
>
>It's now generally well known amongst scripters that constructions like:
>
>
>
> (characters 5 thru 137 of myText) as string
>
>
>
>... can be horrendously wasteful in terms of the memory, processor
>
>cycles, and typing required, and that the equivalent 'text' command is to
>
>be preferred:
>
>
>
> text 5 thru 137 of myText
>
>
>
>The 'as string' construction creates an intermediate, 133-item list,
>
>
Just to be 100% precise for the viewers back home, it's the 'characters X
>
thru Y' construction that creates a list. The 'as string' part simply
>
coerces it back to a string again.
Thanks, has. In context, I was of course referring in a convenient way to
the construction of the entire line, but I can see that it might be taken
wrongly by people with a short attention span.
>
I spent quite a while darkly muttering "smug devil... too clever for his
>
own good... etc" while I trawled through the ASLG actually trying to find
>
mention of this feature. Which I _finally_ did, though it was less than
>
obvious and if you blinked you would miss it completely [not exactly an
>
uncommon occurrence in the ASLG, mind you]. Not at all in the same class of
>
sins, imho, though a bit of an unfortunate oversight, perhaps.
>
>
Still, thanks for the tip, Nigel. And now I think I'll step to the side for
>
a bit - I imagine there's a number of "well-respected scripters" would like
>
a word with you regarding what's left of their public image... [1] ;)
Well, as you've seen, I didn't invent the technique. I just happened to
read about it in the manual. I've known about it for two or three years
and haven't exactly kept it to myself. I'm just surprised that more
people (including those are are *still* well respected by me) aren't
using it.
>
has (more of a Beeb man myself...)
Ah! What you could do with 32K of memory back then! Didn't the Beeb use
line-feed terminated strings? :-)
NG
_______________________________________________
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.