• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple text question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Simple text question (From: Michelle Steiner <email@hidden>)
 >RE: Simple text question (From: "Script2" <email@hidden>)
 >Re: Simple text question (From: "Mark J. Reed" <email@hidden>)
 >Re: Simple text question (From: Michelle Steiner <email@hidden>)
 >Re: Simple text question (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Simple text question
  • Next by Date: Is there a way to check the Ctrl, Alt, Cmd, Shift state?
  • Previous by thread: RE: Simple text question - solved
  • Next by thread: Re: Simple text question
  • Index(es):
    • Date
    • Thread