Re: Check if it is a number
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.