Re: number
Re: number
- Subject: Re: number
- From: "Nigel Garvey" <email@hidden>
- Date: Fri, 23 Sep 2005 21:25:34 +0100
kai wrote on Thu, 22 Sep 2005 23:17:52 +0100:
>On 22 Sep 2005, at 14:51, Nigel Garvey wrote:
>
>> Or:
>>
>> -(get o's x)
>>
>> Or:
>>
>> -(o's x as number)
>>
>> Or:
>>
>> (o's x) * -1
>>
>> Or:
>>
>> 0 - (o's x)
>
>Or:
>
>-(a reference to o's x)
So only _compiled_ references are affected.
>Or:
>
>tell o's x to -it
>
>(But now I'm just playing. Personally, I'd stick with the more direct
>'get'.) ;-)
Here's some more fun. Bernard e-mailed me off list to ask why his
original script does work if the number involved is an integer.
script o
property x : 1
end script
-(o's x)
--> -1
So the problem's with compiled references and reals. However, fooling
around a bit more, we find that the script also works (ie. doesn't throw
errors) with whole-number reals -- except that the results are integers!
script o
property x : 273.0
end script
-(o's x)
--> -273
As jj says, it must be a bug. But I'd love to know what's behind it. The
effect's the same in Tiger, Jaguar, and OS 8.6, so it's been around for a
while....
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden