References and subroutines
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. |
----------------------------------------------------------------------