Allowed coercions
- String
- list with one item
- integer to real
- real to integer (unless real has a fractional part)
Syntax
set theNumber to 25 as number
Description
number
is a synonym for real or
integer. However, the class for a
number with a decimal point will be a
real, and the same goes for a whole number (its
class will be integer). Here are some
illustrations of this:
- theNum is of class integer
Set theNum to 25 as number
- theNum is of class real
Set theNum to 25.1 as number
In other words, the number data type can be used
in AppleScript, but its actual class will be either
integer or real.
|