Re: Simple text question
Re: Simple text question
- Subject: Re: Simple text question
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 7 Jul 2008 17:06:27 -0400
On Mon, Jul 7, 2008 at 5:02 PM, Mark J. Reed <email@hidden> wrote:
> set ch to text (initial - 1) of a
> if ch >= "0" and ch <= "9" then
> if last_digit is 0 then
> set last_digit to initial
> else if (last_digit - initial) is 4 then
> exit repeat
> end if
Note that as written, the variable "last_digit" does not actually
contain the index of the last digit, but that of the opening bracket.
Poor variable naming on my part; I should have called it
"open_bracket" or something instead. (Or I could set it to [initial -
1] and check for a difference of 3 instead of 4, but I think having
the check be for the actual maximum number of digits, instead of one
less than that, makes for greater maintainability.)
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden