• 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: Coercion problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Coercion problem


  • Subject: RE: Coercion problem
  • From: "Scott Babcock" <email@hidden>
  • Date: Tue, 5 Jul 2005 10:27:08 -0700
  • Thread-topic: Coercion problem

Looking at your result, the problem is most likely one of
initialization. In order for the '&' operator to be interpreted as a
list concatenation instead of a string concatenation, the l-value must
be a list:

set newxdates to {}
repeat with idx from head to tail
    set newxdates to newxdates & (item idx of biglist)
end repeat

Also, use the 'end of' clause instead of '&' - it's much faster:

set newxdates to {}
repeat with idx from head to tail
    set end of newxdates to (item idx of biglist)
end repeat


-----Original Message-----
Date: Tue, 5 Jul 2005 07:17:38 -0600
From: Robert Poland <email@hidden>
Subject: Coercion problem
To: AppleScript <email@hidden>
Message-ID: <a06230901bef036f63ff8@[192.168.0.2]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Hi,

I am construction a list of data from a larger list and end up with,
for example, " January 220000000 January 2300000"
What I want is " January 22","0","0","0",""," 0","0","0","January
23","0","0","0","0","0"

The data is gathered by "set newxdates to newxdates  & a".

Any clues on what I'm not doing?

Tia,
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
 _______________________________________________
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

  • Prev by Date: Re: PCRE / grep (was Re: Applescript-users Digest, Vol 2, Issue 443)
  • Next by Date: RE: Coercion problem
  • Previous by thread: Re: Coercion problem
  • Next by thread: RE: Coercion problem
  • Index(es):
    • Date
    • Thread