[comp.sys.mac.programmer] Running MacApp1.1 under MPW 3.0?

djnowak@luna.dpl.scg.hac.com (David Nowak) (06/09/89)

From: djnowak@luna.dpl.scg.hac.com (David Nowak)
Path: luna.dpl.scg.hac.com!djnowak
Newsgroups: comp.sys.mac.programmer
Subject: MacApp1.1.1underMPW3.0
Reply-To: djnowak@luna.dpl.scg.hac.com (David Nowak)
Distribution: world
Organization: Hughes Aircraft Co., El Segundo, CA
Keywords: MacApp,MPW

   I have MacApp 1.1.1 and MPW 3.0.  Seeing as that I never really learned
how to use MacApp under the MPW 2.2 compiler, I thought that I would
recompile it under MPW 3.0 Pascal.  Boy!  What a headache that turned out
to be.  Fortunately, the latest Frameworks magazine had an article in the
back that described how to turn   off the annoying object syntax checking
 that Pascal 3.0 performs.  When I finally, got all of the source code for
the MacApp libraries compiled and linked, I tried to compile and run some
example programs.  Unfortunately, none of them ran.  I consistantly obtained
a SysIdError=28 when I tried to run the resulting applications. HELP!!!
    If anyone out there has overcome this problem, please inform me of how
to overcome it.  Thanks.

djnowak@luna.dpl.scg.hac.com (David Nowak)

keith@Apple.COM (Keith Rollin) (06/12/89)

In article <3949@hacgate.scg.hac.com> djnowak@luna.dpl.scg.hac.com (David Nowak) writes:
>   I have MacApp 1.1.1 and MPW 3.0.  Seeing as that I never really learned
>how to use MacApp under the MPW 2.2 compiler, I thought that I would
>recompile it under MPW 3.0 Pascal.  Boy!  What a headache that turned out
>to be.  Fortunately, the latest Frameworks magazine had an article in the
>back that described how to turn   off the annoying object syntax checking
> that Pascal 3.0 performs.  When I finally, got all of the source code for
>the MacApp libraries compiled and linked, I tried to compile and run some
>example programs.  Unfortunately, none of them ran.  I consistantly obtained
>a SysIdError=28 when I tried to run the resulting applications. HELP!!!
>    If anyone out there has overcome this problem, please inform me of how
>to overcome it.  Thanks.

If you find out what the problems were, please let me know. Most times, I give
that article to developers and they go away happy. At least, I never hear back
from them again, so I assume that they got what they wanted (no jokes, please!). 
In the meantime, here are a couple of pointers:

1) That "annoying object syntax checking" is MPW Pascal's way of telling you
that you have a time bomb in your program. Turning off the error checking 
doesn't make your program work better; it just blinds you to the fact that
you have to fix your program.
   And not just your program too. MacApp has instances of incorrect handle
usage. These will be fixed in the next release of MacApp 2.0, but users of
MacApp 1.1.1 will have to make the appropriate modifications themselves if they
want to be 100% sure that they are practicing safe hex.

2) The article in FrameWorks states that debug versions of your program will 
likely not work. In fact, I have NEVER heard of anyone getting a debug version 
of they MacApp program to work after being compiled with MPW 3.0. You don't 
state above whether or not you are creating non-debug or debug versions of your 
program, so I don't know if this comment applies.

3) You can help us determine what the problem is by giving more complete
information on where the error is occuring. This may be tough if the program
is crashing in MacApp, but you may be able to narrow down the spot by using
debugger statements and SysBeeps.

4) The 3.0 Pascal compiler should not solve any problems that were causing you
to not be able to deal with the 2.0.2 compiler. If none of the above options
help you out, then you might have to stick to a supported configuration (ie,
MacApp 1.1.1 with MPW 2.0.2, or MacApp 2.0 with MPW 3.0).

Hope this helps,
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc.  ---  Developer Technical Support
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions

pane@cat.cmu.edu (John Pane) (06/13/89)

In article <32367@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes:
>2) The article in FrameWorks states that debug versions of your program will
>likely not work. In fact, I have NEVER heard of anyone getting a debug
>version of they MacApp program to work after being compiled with MPW 3.0.
>You don't state above whether or not you are creating non-debug or debug
>versions of your program, so I don't know if this comment applies.

I have successfully patched MacApp 1.1.1 to allow creation of a debugging
version with MPW 3.0.  We use the debugging version daily here on the
MacGnome project, and it seems to work fine.  It's been a while, but here is
a list of what I think I did to get it to work:

UMeasure.p, Line 10:
	 Changed the {$D++} to {$D+}

UTrace.inc1.p, Lines 994-996:
	Replaced this While loop with the While loop and adjacent If
	statement from the MacApp 2.0 code:
		{Search for RTS or JMP (A0) or RTD #$00nn}	
		{Thanks to Mike Bentley}
		WHILE (pc^ - 1 <> $4E75 - 1) &
		  (pc^ - 1 <> $4ED0 - 1) &
		  (pc^ - 1 <> $4E74 - 1) DO
			pc := ZPINTEGER(ORD(pc) + 2);

		IF pc^ - 1 = $4E74 - 1 THEN
			{If it was RTD, skip past displacement}
			pc := ZPINTEGER(ORD4(pc) + 2);
MacApp.make1, Line 10:
	Add the compiler switch "-mbg ch8" to the PascalOptions variable.

--
John Pane						pane@cs.cmu.edu
School of Computer Science 
Carnegie Mellon University				(412) 268-5884
-- 
John Pane						pane@cs.cmu.edu
School of Computer Science 
Carnegie Mellon University				(412) 268-5884
-- 

pane@cat.cmu.edu (John Pane) (06/14/89)

In article <5202@pt.cs.cmu.edu> pane@cat.cmu.edu (John Pane) writes:
>I have successfully patched MacApp 1.1.1 to allow creation of a debugging
>version with MPW 3.0.  We use the debugging version daily here on the
>MacGnome project, and it seems to work fine.  It's been a while, but here is
>a list of what I think I did to get it to work:
> ...

One more thing...You can't use the "-opt on" switch to the linker when
making a debug version.

Also, the code that I posted in my previous message is the code to insert in
place of the old code on lines 994-6 of UTrace.inc1.p.  That may not have
been clear in my post.  The replacement code is verbatim from the MacApp 2.0
sources.

--
John Pane						pane@cs.cmu.edu
School of Computer Science 
Carnegie Mellon University				(412) 268-5884
-- 
John Pane						pane@cs.cmu.edu
School of Computer Science 
Carnegie Mellon University				(412) 268-5884
--