• 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: 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.

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

  • Prev by Date: Re: Aliases in paths not resolved....????
  • Next by Date: illustrator: deleting invisible layers?
  • 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