Re: Why save text item delimiters? Philosophical question....
Re: Why save text item delimiters? Philosophical question....
- Subject: Re: Why save text item delimiters? Philosophical question....
- From: John Delacour <email@hidden>
- Date: Mon, 16 Jun 2003 23:50:06 +0100
- Mac-eudora-version: 6.0b20
At 3:01 pm -0400 16/6/03, Gary Lists wrote:
I am a JD-style user: always set them in the line before I need them.
Never had a problem.
If I have a script that requires a lot of splitting and joining, I
add stock handlers to avoid the noise. I just hate those verbose
scripts that appear so often on this list where you have to plough
through line after line of "set oldDelimiters to Applescript's text
item delimiters". It was Sal's crowd that started this nonsense and
a whole lot more.
replaceXY("hello", "e", "u")
on splitString(_string, _cut)
set my text item delimiters to _cut
set ls to text items of _string
set my text item delimiters to ""
return ls
end splitString
on joinItems(_items, _glue)
set my text item delimiters to _glue
set s to _items as string
set my text item delimiters to ""
return s
end joinItems
on replaceXY(_string, x, y)
set ls to splitString(_string, x)
set s to joinItems(ls, y)
end replaceXY
_______________________________________________
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.