Re: "+" and "-" are numbers.
Re: "+" and "-" are numbers.
- Subject: Re: "+" and "-" are numbers.
- From: Deivy Petrescu <email@hidden>
- Date: Fri, 02 Aug 2002 11:16:16 -0400
At 10:54 AM -0400 8/2/02, Paul Skinner wrote:
set testList to {"-", "+"}
repeat with thischar in testList
try
thischar as number
display dialog thischar & " is a number"
on error
display dialog thischar & " is not a number"
end try
end repeat
-->"- is a number"
-->"+ is a number"
"+" as number
-->0
"-" as number
-->0
Why?
--
Paul Skinner
For the same reason that
set l to ""
l as number
--> 0
That is "+" (or "_") as number can be written as """+""" or 0+0
Regards
--
Deivy Petrescu
http://www.dicas.com
_______________________________________________
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.