Re: Check if it is a number
Re: Check if it is a number
- Subject: Re: Check if it is a number
- From: "Marc S.A. Glasgow" <email@hidden>
- Date: Fri, 6 Dec 2002 01:18:58 -0500
How about:
on NumeralsOnly(n)
try
return (0=n-n) as boolean
-- or return n if prefered
on error
return false as boolean
end try
end NumeralsOnly
I haven't speed checked it, but it seems simpler in executable steps
than the offered handler.
=-= Marc
on NumeralsOnly(n)
try
n as number
return not ((count of n) = 0 or n contains "-" or n contains "+")
on error
return false
end try
end NumeralsOnly
_______________________________________________
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.