Re: can I do this better? [trim whitespace]
Re: can I do this better? [trim whitespace]
- Subject: Re: can I do this better? [trim whitespace]
- From: "Daniel A. Shockley" <email@hidden>
- Date: Thu, 13 Jun 2002 09:28:01 -0400
There is one other consideration for these functions: how big is the
string and/or whitespace you want to trim? Most (all?) of the
handlers I saw posted will fail if they go over about 4050
characters, since AppleScript gets a stack error when parsing
characters into a list of that length. Doesn't matter how much memory
you give it, it's built into AppleScript. Of course, you could then
use an OSAX or break it into chunks using has's chunkText library
(which i believe is vanilla AppleScript).
Just wanted to point out this one potential issue. I ran into it when
working with downloading others' web pages, many of which had a lot
more than 4050 characters.
From: Ric Phillips <email@hidden>
To: Apple Script <email@hidden>
On 13/6/02 3:47 AM, "garrett" <email@hidden> wrote:
hey!
I wrote this little routine to trim off any trailing or beginning spaces or
returns. would any of u pros do it differently or better? if so, how and
why?
Well, a great deal depends on what you consider to be 'better'. For some
that is purely a matter of speed, for others readability of the source - and
then there is memory usage, and / or just plain elegance!
--
----
Daniel A. Shockley
email@hidden
email@hidden
http://www.danshockley.com
_______________________________________________
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.