• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "+" and "-" are numbers.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >"+" and "-" are numbers. (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: making a new folder
  • Next by Date: Re: making a new folder
  • Previous by thread: "+" and "-" are numbers.
  • Next by thread: Re: "+" and "-" are numbers.
  • Index(es):
    • Date
    • Thread