• 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: Basic Q: When is a string not a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic Q: When is a string not a string?


  • Subject: Re: Basic Q: When is a string not a string?
  • From: Emmanuel <email@hidden>
  • Date: Sun, 25 Jan 2004 00:41:45 +0100

At 2:23 PM -0600 24/01/04, Chap Harrison wrote:
>I just don't understand this language. Sure I have a workaround, but I'd like to know what concept I'm unclear on here. Please help a despairing lad ;-)

The point is that "repeat with an_item in a_list" is a very original and very smart feature of AppleScript. Usually languages use counter in loops, and usually you may change the value of the counter inside the loop. Inside a "loop in a list" in AppleScript, you can also change the value of the list item.

So, you may do:

----------------
repeat with theItem in theList
set contents of theItem to 1
end
----------------

this will fill the list with ones.

This to present it as naturally as possible that theItem carries a reference to the given item in the list, not the value of that item.

Emmanuel
_______________________________________________
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: 
 >Basic Q: When is a string not a string? (From: Chap Harrison <email@hidden>)

  • Prev by Date: Fun error messages (was Re: styled text to record, ...)
  • Next by Date: Re: Fun error messages (was Re: styled text to record, ...)
  • Previous by thread: Re: Basic Q: When is a string not a string?
  • Next by thread: Panther: Quark 6 to PostScript Page Range Possible?
  • Index(es):
    • Date
    • Thread