Re: Error trap if item cannot be made into an integer?
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.