[comp.sys.mac] Help needed with INIT's in MPW Pascal...

spector@acf3.NYU.EDU (David HM Spector) (10/15/87)

As I recall Macintosh INIT resources are supposed to be just code
ending in an RTS, right?  I am writing a (very) small init in MPW Pascal
which seems to work fine on a Macintosh Plus, but causes my MacintoshII
to quickly visit Macsbug with an address error.   In looking at the
code generated by MPW, I notice that the code gets bracketed by a link/unlink
pair, and does indeed end in an RTS.  Using dumpcode in MPW to look at
lots of other INITs, from Apple and public domain sources, I notice that
they have no link/unlinks and some seem to have a header containing the
word "INIT"...   have I been up too long,..am I missing something? too much
coffee,  or what?   :-)

Does anyone have the source to a small Pascal init they'd care to share?


Please respond via mail, I'll summarize..

	Thanks,
	  David

David HM Spector				New York University
Senior Systems Programmer			Graduate School of Business
SPECTOR@NYU.EDU					90 Trinity Place
...!{allegra,rocky}!cmcl2!spector		New York, NY 10006

Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: russell@acf3.NYU.EDU (Bill Russell)
Date: 16-Oct-87 03:03 EDT
Date-Received: 16-Oct-87 03:03 EDT
Subject: Re: Parity on Apple memories
Message-ID: <170031@acf3.NYU.EDU>
Path: acf3!russell
Newsgroups: comp.sys.mac
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <15260@clyde.ATT.COM>

"Parity is for farmers." -- S. Cray
(But I think he's changed his mind since this was originally uttered [196x].)
-r
(Richard Reich as russell@nyu)
Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: dube@acf3.NYU.EDU
Date: 15-Oct-87 08:19 EDT
Date-Received: 15-Oct-87 08:19 EDT
Subject: Re: Credit cards
Message-ID: <1410001@acf3.NYU.EDU>
Path: acf3!dube
Newsgroups: misc.invest
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <kVQx5by00UgyUAU0-G@andrew.cmu.edu>


Barron's Financial Weekly has a listing of credit card fees and rates,
including a couple of no-annual-fee cards, in each issue.  It
appears on the next to last page (or thereabouts).

That's where I found out about Mastercard from Dauphin Deposit Bank
in St Louis (?), which I've now been using for several months.
I have had no problem, and no annual fee either.
Don't know if you'll need a cosigner, though.

Good Luck,  Ira Kaplan     kaplani@csd2.nyu.edu


Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: dube@acf3.NYU.EDU
Date: 15-Oct-87 15:37 EDT
Date-Received: 15-Oct-87 15:37 EDT
Subject: Re: Credit cards
Message-ID: <1410002@acf3.NYU.EDU>
Path: acf3!dube
Newsgroups: misc.invest
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <kVQx5by00UgyUAU0-G@andrew.cmu.edu>


I just looked in this week's Barron's, and it didn't have the
credit card listings, so I guess it's not in each issue.
Sorry ...  look through some of the more recent issues, or just try
to get in touch with 
	Dauphin Deposit Bank & Trust Company
	PO Box 4385   Harrisburg PA 17111

(not St Louis!)
which charges me no annual fee.
Disclaimer: I could be wrong.
Disclosure: My only connection to this Bank is my plastic, and I
	anticipate no gain from this posting.

Ira Kaplan  kaplani@csd2.nyu.edu

Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: bako@acf3.NYU.EDU
Date: 15-Oct-87 20:18 EDT
Date-Received: 15-Oct-87 20:18 EDT
Subject: Re: OM4T fell on the ground, what to do?
Message-ID: <320003@acf3.NYU.EDU>
Path: acf3!bako
Newsgroups: rec.photo
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <759@sbcs.sunysb.edu>

Thank god for those rugged titanium bodies...

------------------------------------------------------------------------

John Bako       ARPA:  bako@ACF4.NYU.EDU
@ N.Y.U.        UUCP:  {cbosgd, harvard, ihnp4, seismo}!cmcl2!acf4!bako
                Thats a lowercase L in cmcl2 above...    ^^^^^

spector@acf3.NYU.EDU (David HM Spector) (10/17/87)

Well, I found the answer to my INIT question after perusing my collection of 
TechNotes.

All of the info on INITs, FKEYs, et al can be found in TechNote #110
entitled: "MPW: Writing Standalone Code in MPW Pascal"

And for those wanting to see an INIT in person, excerpted below is
the INIT example from the TechNote:

Into a file called "Init.p" place:


UNIT MyInit; {standalone code is written as a UNIT}

INTERFACE
  USES
	{$Load PasDump.dump}
	Memtypes, QuickDraw, OSIntf, ToolIntf;

{NOTE: We cannot use global variable, since we are writing standalone code}

PROCEDURE BeepTwice;

IMPLEMENTATION

PROCEDURE BeepTwice;
VAR finalTicks : LongInt;

Begin {BeepTwice}
  SysBeep(1);
  Delay(120, finalTicks); {Delay two seconds}
  SysBeep(1);
End;  {BeepTwice}

End. {UNIT}



Compile this with "Pascal Init.p", which will result in a file Init.p.o.

Next,  Link the Init with:

link -rt INIT=0 -m BEEPTWICE -o MyInit Init.p.o "{Libraries}"interface.o

This will give you an INIT in the file "MyInit" which will run when put into
the System Folder and you Macintosh is rebooted.



TechNote #110 also covers FKEYs and WDEFs and provides a number of caveats
on what NOT to do when writing such things.  I believe that this TechNote is
available from Sumex-Aim and I _know_ its available from (ick) APDA.


	Dave Spector

David HM Spector				New York University
Senior Systems Programmer			Graduate School of Business
SPECTOR@NYU.EDU					90 Trinity Place
...!{allegra,rocky}!cmcl2!spector		New York, NY 10006