[comp.sys.mac.programmer] Could someone with the manual to Lightspeed Pascal look something up?

vrm@blackwater.cerc.wvu.wvnet.edu (Vasile R. Montan) (05/22/91)

Dear all,

Universities are even more woefully underfunded these days than usual.
As a result, our CS department at has the old Lightspeed Pascal
(now reincarnated as THINK Pascal, which we don't have) as its sole
Mac Pascal compiler.  Since this is what we've got, this is what I'm stuck
with.  (Not that it's a particularly bad piece of software; it's just
that not too many people are using it elsewhere, so getting info can
be a little tough.)
     Well, since we're between semesters, the lab with the bookshelf
containing all of our manuals is locked, and I can't get to it.  Sounds
like a job for Murphy's law!  Here is my problem:
     I am writing a long program broken into many separate code files.
I use USES statements to connect the files together.  Example:

uses
   ColorMenuMgr, Initialize, Animator, Builder, Utilities;

     In the particular unit containing the list above, I make no
calls to the ListManager unit.  However, in some of these units
(such as Builder), I *do* call the ListManager, and I have it
appropriately listed in Builder's USES statement.
     For some reason, when I build the project, the example unit
above refuses to compile.  A thumbs-down appears next to the
USES list, saying 'ListHandle not declared.'  Yet nowhere in this
unit do I refer to the ListManager.  Obviously, I'm doing something
wrong with my USES lists or my compile order or something.
     I've run into this same problem before, and I've solved it
inelegantly by simply inserting the name of the appropriate unit
into the USES list.  In this case, however, this solution won't
work, because including the ListManager in this particular unit
takes me past a certain limit and I get an error message along
the lines of 'This unit, with its interfaces, is too large to
compile.'
     Because of the way my program's put together, taking anything out
of this unit would require a great deal of work and would considerably
reduce the clarity and neatness of my code.  There must be some way
to convince this unit that it has no need of the ListManager.  Can
anyone help me out?

At a standstill :-(
--Kurisuto
un020070@vaxa.wvnet.edu

vrm@babcock.cerc.wvu.wvnet.edu (Vasile R. Montan) (05/23/91)

From article <1783@babcock.cerc.wvu.wvnet.edu>, by vrm@blackwater.cerc.wvu.wvnet.edu (Vasile R. Montan):
[Article deleted]

Well, good luck returned this morning.  The site with the crucial book
was open, and I found the answer to my problem.  I am going to post it
in case anyone else runs into the same problem.
     Suppose I have three units in my program; let's call them Main,
Utilities, and ListManager.  Main uses Utilities, and Utilities uses
ListManager.  Well, does Main also have to use ListManager?  It depends.
If there is anything in the *interface* section of Utilities which
refers to the declarations in ListManager, then Main has to include
ListManager as well, since Main refers to Utilities' interface.
However, if my only references in Utilities to ListManager are in
the *implementation* section, then Main doesn't have to use ListManager.
     Well, at last I know how it works.

--Kurisuto
un020070@vaxa.wvnet.edu