🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #20442

Re: Help needed with INIT's in MPW Pascal...

#20442
From: David HM Spector
Date: Sat, 17 Oct 1987 04:44
61 lines
2062 bytes
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
Technical Details
Message-ID: <170032@acf3.NYU.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!acf3!spector
References: <170030@acf3.NYU.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!acf3!spector
From: spector@acf3.NYU.EDU (David HM Spector)
Newsgroups: comp.sys.mac
Subject: Re: Help needed with INIT's in MPW Pascal...
Message-ID: <170032@acf3.NYU.EDU>
Date: Sat, 17-Oct-87 00:44:00 EDT
Article-I.D.: acf3.170032
Posted: Sat Oct 17 00:44:00 1987
Date-Received: Sun, 18-Oct-87 09:43:27 EDT
References: <170030@acf3.NYU.EDU>
Organization: New York University
Lines: 61