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: Emmanuel <email@hidden>
- Date: Tue, 19 Nov 2002 19:52:56 +0100
At 5:12 PM -0600 18/11/02, Kenton Muschenheim wrote:
I'm looping through items in a list and I want to skip the item if the item
name can't be made into an integer. What's the syntax to trap the "Can't
make into an integer" error?
In case you can get the list of the names, you may want to know the
following trick:
==============================
set x to {"2.3", "3.4", "foo"}
numbers of (addlist x with 0)
--> {2.3, 3.4}
==============================
(uses the Satimage osax' "addlist" command)
The "numbers of ..." trick is after a post by Victor Yee.
(you can recover a list of strings with:
set text item delimiters to return
text items of ({2.3, 3.4} as string)
)
Emmanuel
_______________________________________________
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.