[comp.sys.mac.programmer] Sublaunching from MPW

bnfb@june.cs.washington.edu (Bjorn Freeman-Benson) (02/02/89)

I have a program that would like to run the MPW C compiler as a
subtask.  This program is an MPW Tool, and I would like to run the C
compiler just the way that the Shell runs a Tool --- it runs that
then control returns to the Shell.

Do any of you Mac experts have a solution?  (My situation -- I now
how to program in C, in PASCAL, in 680x0, etc.  I write UNIX
programs and MS-DOS programs and have just started on the Macintosh.
I have IM I-V, the Tech notes, MPW 3.0, etc.)

Thanks for your e-mail,
Bjorn

norbert@iraul1.ira.uka.de (Norbert Lindenberg) (02/05/89)

Bjorn Freeman-Benson asks: 
> I have a program that would like to run the MPW C compiler as a
> subtask.  This program is an MPW Tool, and I would like to run the C
> compiler just the way that the Shell runs a Tool --- it runs that
> then control returns to the Shell.

Nope, subprocesses are not supported by MPW, the Shell only allows
to run one tool at a time. The general workaround is to split
the single program you would have under Unix into two parts for MPW:
a tool that creates a script, and a script that runs your tool and
executes the tool's output. Look at the way the BuildProgram script
uses the Make tool to get the idea.

-- Norbert