• 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: Check if it is a number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check if it is a number


  • Subject: Re: Check if it is a number
  • From: Kai Edwards <email@hidden>
  • Date: Tue, 03 Dec 2002 11:23:58 +0000

on Mon, 2 Dec 2002 19:46:10 +0100, Thomas <email@hidden> wrote:

> Yea, that's already the method I use. So there's nothing better but that
> works :-)
>
> Kai Edwards wrote :
>
>> Try this, Thomas:
>>
>> ================
>>
>> isNum("AB45DJI")
>>
>> on isNum(v)
>> try
>> v as number
>> true
>> on error
>> false
>> end try
>> end isNum
>>
>> ================

Sorry Thomas - didn't mean to teach grandma to suck eggs! :-)

If you're after greater brevity and speed[1], you could always try:

===========================

v's items is in "012356789"

===========================

Kai

---------------------------

[1] OMM it's generally 50-500% faster than a try block - depending on the
number of tests/comparisons in the block.

--
email@hidden
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: Check if it is a number
      • From: Kai Edwards <email@hidden>
  • Prev by Date: Re: Dialogs (Open/Print file (PhotoShop) without dialog missing fonts )
  • Next by Date: Re: Check if it is a number
  • Previous by thread: Re: Check if it is a number
  • Next by thread: Re: Check if it is a number
  • Index(es):
    • Date
    • Thread