Check if it is a number
Check if it is a number
- Subject: Check if it is a number
- From: Thomas <email@hidden>
- Date: Wed, 27 Nov 2002 23:19:27 +0100
Hi all, I have a string like this one "12A4B5" and I want to check for
each text item if this is a number and do something or if this not a
number and do another thing.
Is there a better way than using a try block to check if the current
text item is a number ?
Currently I'm using this method :
set my_text to "12A4B5"
repeat with from 1 to count of my_text
set current_item to item i of my_text
try
current_item as number
--this is a number
on error
--this is not a number
end
Thanks Thomas
_______________________________________________
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.