• 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: What is this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is this?


  • Subject: Re: What is this?
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 28 Feb 2005 16:54:03 -0500


On Feb 28, 2005, at 15:31, kai wrote:

set l to {}
repeat with n from 0 to 10
	set n to n as string
	set c to count n + 1
	set l's end to {n:n, r:0 + (item c of n)}
end repeat
l


kai, when I run your script I get weird things.
First, I get an error running it in Smile. Not on SE.
When I log c, I get 1 all the time (???). By the numbers you get, I believe you do not get the same thing



Although, yes, sum or subtraction *before* (item c of n) they always return n.
After (item c of n) they all generate the expected error.
Look what I get:


set l to {}
repeat with n from 0 to 10
	set n to n as string
	set c to count n + 1
	log c & (count n)
	set l's end to {n:n, r:0 + (item c of n)}
end repeat
l

-->{{n:0, r:0}, {n:1, r:1}, {n:2, r:2}, {n:3, r:3}, {n:4, r:4}, {n:5, r:5}, {n:6, r:6}, {n:7, r:7}, {n:8, r:8}, {n:9, r:9}, {n:10, r:1}}


Last night, I tried modifying a series of the quoted integer (0 * (item 2 of "1"), 0 * (item 2 of "2"), etc.) - and was rewarded with a sequence that started:

"1" --> 1.41429518792415E-304
"2" --> 2.82859037584831E-304
"3" --> 4.24288556377246E-304

And the second way to get different results? Today, I tried running the same script and was presented with this:

"1" --> 1.38937436070887E-304
"2" --> 2.77874872141775E-304
"3" --> 4.16812308212662E-304

I find it hard to believe myself that this happened on the same machine. If it didn't, then I'm moving into the advanced stages of senility. Go figure...

You probably had quit some applications from one time to the other.

I believe Nigel got the problem with respect to *. But It does not explain the problems with + or -.

Another weird stuff is, if there is a log (item 2 of "9") for instance it sometimes gives the error as expected.

It is indeed some very weird.


deivy -------------------------------------------- Agora quem da bola é o Santos, Salve o novo campeão!

_______________________________________________
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


References: 
 >Re: What is this? (From: kai <email@hidden>)

  • Prev by Date: Re: What is this?
  • Next by Date: Re: Called script won't store property
  • Previous by thread: Re: What is this?
  • Next by thread: Re: What is this?
  • Index(es):
    • Date
    • Thread