Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!leonardr
From: leonardr@uxe.cso.uiuc.edu
Newsgroups: comp.sys.mac.programmer
Subject: Re: DA question
Message-ID: <226000017@uxe.cso.uiuc.edu>
Date: 1 Jun 88 16:46:00 GMT
References: <2896@thorin.cs.unc.edu>
Lines: 39
Nf-ID: #R:thorin.cs.unc.edu:2896:uxe.cso.uiuc.edu:226000017:000:2308
Nf-From: uxe.cso.uiuc.edu!leonardr    Jun  1 11:46:00 1988


bolter@unc.cs.unc.edu(??) writes in comp.sys.mac.programmer


>Can anyone suggest how to create a Desk Accessory with a large 
>amount of code (say 70 or 80K)? What are the factors that limit 
>you to 32K? Is it possible, for example, to store more code in one's 
>own resources (in addition to the DRVR resource) and then call in 
>that code as needed. If so, how do you pass control to and from these 
>code resources? Can anyone suggest any books or articles that discuss 
>problems of large DAs? (I am programming in MPW Pascal.)

	It is possible to creeate DA's which are larger thatn the 32K limit that
is imposed by the size of resources (of which the DRVR is one).  This is 
apparent when you try to install such DA's as DiskTop or DiskTools.
	The reason taht you are 'normamly' limited to 32K is that DRVR resourcw which
contains your code is limited to 32K. To get around this problems (as I have 
recently in SigmaEdit) what you must do is to use the DRVR for your main code
and any code that uses a LOT of globals and put all thre rest of your code in
other code type resources.  I use PROC's, but it does not matter as long as they
are compiled as code resources.  You then just load these up as need be and
call them.  What you need to do is to simulate the _LoadSeg trap.  Rich Siegel
(our local Think rep) gave an example of doing this from LSP, and the same would
how true for MPW Pascal.
	The only place that I have seen this discussed was in an old article by
David Dunham in MacTutor (I believe that it is reprinted in Best of Mac Tutor
Volume I)
	Hope this helps...

+---------------------------------+-----------------------------------+
+                                 +  Any thing I say may be taken as  +
+   Leonard Rosenthol             +  fact, then again you might decide+
+   President, LazerWare, inc.    +  that it really isn't, so you     +
+                                 +  never know, do you??             +
+   leonardr@uxe.cso.uiuc.edu     +                                   +
+   GEnie:  MACgician             +                                   +
+   Delphi: MACgician             +                                   +
+                                 +                                   +
+---------------------------------+-----------------------------------+