Re: numbers in a variable.
Re: numbers in a variable.
- Subject: Re: numbers in a variable.
- From: David Durkee <email@hidden>
- Date: Thu, 31 Jul 2003 13:54:54 -0500
set thetext to "3 Canon color"
set thewords to every word in thetext
set numberfound to false
repeat with aword in thewords
try
aword as number
set numberfound to true -- this line will be skipped if the previous
line returns an error
end try
end repeat
return numberfound
On Thursday, July 31, 2003, at 12:58 PM, Ruby Madraswala wrote:
How do I check if a variable contains numbers (can range from 1 to
99)? I tried:
If newword contains [1-99] then
Do something
Else
It's a heading
End if
I don't get any error message and "do something" does not work which
right now is just few display statements.
Example:
Printers
1 HP laserjet
2 HP inkjet
3 Canon color
Plotters
4 xerox
5 oce
and so on.
Thanks in advance.
Ruby
_______________________________________________
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.
--
David Durkee
email@hidden
<
http://ddurkee.homeip.net/>
_______________________________________________
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.