Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!think!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Standard File and Desk Accessories Message-ID: <2016@husc6.harvard.edu> Date: 7 Jun 89 20:13:02 GMT References: <50967@tut.cis.ohio-state.edu> <7547@hoptoad.uucp> <4972@umd5.umd.edu> <51276@tut.cis.ohio-state.edu> <4975@umd5.umd.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec/THINK Technologies, Bedford, MA Lines: 35 In article <4975@umd5.umd.edu> zben@umd5.umd.edu (Ben Cranston) writes: >Re: using one of the development packages that implements local variables for >DAs and other data-less code resources by using A4 as an ersatz global pointer. > >Standard File saves A4 on entry and uses it to point to other things! For >much of the routine it points to the SFReply record, however several of the >subroutines save it and use it for local purposes! In principle, you're correct. In practice, TLSP and TLSC provide SetupA4() and RestoreA4(), which are to be used in routines which are callbacks from the Toolbox or other places that don't know about the A4 global conventions. This works quite well - a number of DA's have been written using A4 globals in TLSC, and they work, and they do use Standard file. > [outlines other methods, like using the refcon and expecting it > to point to SF's frame pointer] It's best to use the standard callback mechanism, since you never know when the people who wrote Standard File may decide to keep SF's A6 some- where else. As I said above, callbacks written using TLSC and TLSP will work fine, provided you use SetupA4() and RestoreA4(). --Rich ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "She told me to make myself comfortable, so I pulled down my pants and sat in the pudding." -Emo Phillips ~~~~~~~~~~~~~~~