Re: abs bug?
Re: abs bug?
- Subject: Re: abs bug?
- From: Bill Briggs <email@hidden>
- Date: Sat, 29 Nov 2003 13:40:14 -0400
At 10:04 AM -0700 29/11/03, Robert Poland wrote:
On Nov 29, 2003, at 9:25 AM, Robert Poland wrote:
Is this a bug? From Satimage Dictionary.
set x to -44
abs x
x
--> -44
Robert,
Try
set x to -44
set x to abs x
x
that should reveal 44 as the answer. Also, if you removed the last
line (x) of your code, it should display 44.
--
Chris Garaffa
email@hidden
Thanks Chris,
After I thought about it it was obvious. Should have realized that
the dictionary was misleading me.
The dictionary wouldn't have misled you. Why would you think that?
When you write "abs x" the result of that evaluation is put in a
variable called "result", and that's what would display in the result
window if you left out the last line. You didn't reassign the
contents of "x", so it will still be -4. The fact that you put the
"x" as the last line of the script means that you see the stored
value of x in the result window, not the result of the "abs"
evaluation. Nothing to do with the dictionary really. If you had an
editor that would allow you to step through the code line by line and
observe the variables and the result as you go, then you'd see that
"abs x" does indeed return what you want. As Chris pointed out, you
need to store the result in x (or a new variable) if you want to use
it because values in the "result" variable are transitory and get
expunged after the next line of code that returns a result has been
executed.
- web
_______________________________________________
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: | |
| >abs bug? (From: Robert Poland <email@hidden>) |
| >Re: abs bug? (From: Chris Garaffa <email@hidden>) |
| >Re: abs bug? (From: Robert Poland <email@hidden>) |