• 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
Bug on references under OS>8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug on references under OS>8


  • Subject: Bug on references under OS>8
  • From: Emmanuel <email@hidden>
  • Date: Wed, 5 Sep 2001 23:24:13 +0200

I know that much has been posted on this topic, that I did not thoroughly
read, so I present my apologies in advance for stating the obvious - yet,
thanks in advance for pointing me to some information on the subject.

-----------------------
on TestRef(theRef)
item 1 of (get contents of theRef)
end TestRef

set theVar to {"it works"}
set theRef to a reference to theVar
TestRef(theRef)

-- "it works"
-----------------------

-----------------------
on TestRef(theRef)
item 1 of (get contents of theRef)
end TestRef

on Testit()
set theVar to {"it works"}
set theRef to a reference to theVar
TestRef(theRef)
end Testit

Testit()

-- error -1700 in SE "could not make the data into the expected type"
-- error -1700 as applet
-- error -1728 in Smile "could not get theVar"
-----------------------

(error messages may differ: the above are translations from French)

This is bug, since the programmer expects "theRef" to contain a reference
to the very variable "theVar of the Testit() handler". Instead, it contains
a very virtual and very dangerous reference to "theVar of whatever is
around as a context".

I insist that the transmission of references worked flawlessly before AS
1.4.3. Some handler ("ExtractScriptFromLine") in one of the important
scripts of Smile, used to change the contents of a list that was passed as
the argument. It got broken (and re-written, now returning the changed
list) since 1.4.3.

Note about SortedRefNumbers.
The present post was prompted by our tests of SortedRefNumbers, a handler
proposed by AK and which uses a reference to a list. As I understand it,
SortedRefNumbers can work only if called from the unnamed handler of the
script to which it belongs. I posted erroneous results because
SortedRefNumbers, that I was calling from a handler, so it should not have
worked, was really working on a different variable than the one I thought -
namely a 'theList' belonging to the global, persistent, context of Smile.

Best regards,
Emmanuel


  • Follow-Ups:
    • Re: Bug on references under OS>8
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: QuarkXPress origin of bounds property
  • Next by Date: Re: Sort items in a list without OSAXen
  • Previous by thread: Re: Read Text File to Rename Images - Please help!
  • Next by thread: Re: Bug on references under OS>8
  • Index(es):
    • Date
    • Thread