• 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: Error trap if item cannot be made into an integer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error trap if item cannot be made into an integer?


  • Subject: Re: Error trap if item cannot be made into an integer?
  • From: Richard Morton <email@hidden>
  • Date: Wed, 20 Nov 2002 21:22:59 +1100

On Tuesday, November 19, 2002, at 05:49 PM, email@hidden wrote:

copy oneItem as integer to end of integerList
on error number -1700
end try
end repeat
return integerList

You'll also notice that this script works just as well with "number -1700"
commented out. That means you're just skipping over any item that generates
any kind of error when you try to coerce it to an integer. I can't imagine
what other errors those might be.

I'll hereby confess that when I've had to deal with this situation, I'm
usually too lazy to bother with specifying an error number. If that's a
dangerous practice, I hope someone will correct me.

I've found that silently passing all errors like this can create really difficult debugging scenarios. I don't see any reason why it would be necessary in this particular situation, but it's the ones you don't see coming that bite you.

Bit N
_______________________________________________
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.

References: 
 >Re: Error trap if item cannot be made into an integer? (From: email@hidden)

  • Prev by Date: Re: Making Labels in Quark
  • Next by Date: Re: ASLG updated, slightly
  • Previous by thread: Re: Error trap if item cannot be made into an integer?
  • Next by thread: Re: Error trap if item cannot be made into an integer?
  • Index(es):
    • Date
    • Thread