Re: Today's Question - poke a character in a string
Re: Today's Question - poke a character in a string
- Subject: Re: Today's Question - poke a character in a string
- From: "Arthur J. Knapp" <email@hidden>
- Date: Wed, 31 Jul 2002 13:21:24 -0400
>
Date: Wed, 31 Jul 2002 01:12:32 -0700
>
Subject: Re: Today's Question - poke a character in a string
>
From: Paul Berkowitz <email@hidden>
>
> set MyLongString to (characters 1 thru (CurrentIndex-1) of MyLongString) &
>
> ">" & (characters (CurrentIndex+1) thru end of MyLongString) as string
>
set MyLongString to (text 1 thru (CurrentIndex - 1) of MyLongString) &
>
">" & (text (CurrentIndex +1 ) thru end of MyLongString)
>
>
Of course it doesn't look quite so arduous if you write that as:
>
>
set s to text 1 thru (c - 1) of s & ">" & text (c + 1) thru -1 of s
It also doesn't look so bad thru the judicious use of the line
continuation character, (which I have used ` to represent):
set MyLongString to "" & `
characters 1 thru (CurrentIndex - 1) of MyLongString & `
">" & `
characters (CurrentIndex + 1) thru end of MyLongString
set MyLongString to "" & `
text 1 thru (CurrentIndex - 1) of MyLongString & `
">" & `
text (CurrentIndex + 1) thru end of MyLongString
set s to `
text 1 thru (c - 1) of s & `
">" & `
text (c + 1) thru -1 of s
set s to `
s's text 1 thru (c - 1) & `
">" & `
s's text (c + 1) thru -1
tell (s) to set s to `
text 1 thru (c - 1) & `
">" & `
text (c + 1) thru -1
;-) OK, whether or not it looks bad is a matter of opinion. ;-)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.