• 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
References and subroutines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

References and subroutines


  • Subject: References and subroutines
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 4 Jul 2001 10:05:17 -0700

This comes from the Applescript newsgroup.

The above generates an error ("Can't set end of theList to 7.")

my ExecuteScript()

on ExecuteScript()
set theList to {}
set theListRef to a reference to theList
set theNum to 7
copy theNum to the end of theListRef
end ExecuteScript


Outside the subroutine, it works.

set theList to {}
set theListRef to a reference to theList
set theNum to 7
copy theNum to the end of theListRef


I discovered that this also fails inside a subroutine:

my ExecuteScript()

on ExecuteScript()
set theList to {5}
set theListRef to a reference to theList
contents of theListRef
end ExecuteScript
--> Can't make some data into the expected type.

The length of the list is immaterial.

Is this an applscript bug?

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: References and subroutines
      • From: John W Baxter <email@hidden>
  • Prev by Date: Re: Date Variables that modify themselves! Huh?
  • Next by Date: Re: akua sa
  • Previous by thread: "Size of Finder Selection" for Mac OSX
  • Next by thread: Re: References and subroutines
  • Index(es):
    • Date
    • Thread