[comp.lang.pascal] EXEC GIF files from within Turbo Pascal 5.5

6500boo@ucsbuxa.ucsb.edu (William Bushing) (12/04/90)

Okay, so I'm new to this forum and somewhat new to Pascal as
well. I've written a program to identify the green algae
using a dichotomous key. Once the identification is made, I
want to be able to use FASTGIF to display a GIF file of the
alga itself on the screen.

My program is written in Turbo Pascal 5.5. I assumed I needed
to use EXEC to call up FASTGIF as a child process but when I
wrote what I thought would do the trick, it didn't work.
Neither did trials #2....#3,084,231.

Can someone simply e-mail me or post the proper way to use
EXEC to call up FASTGIF and my GIF file. At present Turbo
Pascal 5.5 is on the C: drive while FASTGIF and the *.GIF
files are all on the D: drive in directory D:\GRAPHICS\GIF.

Thanks for the help.

Bill Bushing
:r sigfile

zhou@brazil.psych.purdue.edu (Albert Zhou) (12/04/90)

Try to set heap size as zero with compiler directive:

{$M 10000, 0,0}
.

rind@popvax.uucp (747707@d.rind) (12/04/90)

In article <7622@hub.ucsb.edu> 6500boo@ucsbuxa.ucsb.edu (William Bushing) writes:
>wrote what I thought would do the trick, it didn't work.
>Neither did trials #2....#3,084,231.
>Can someone simply e-mail me or post the proper way to use
>EXEC to call up FASTGIF and my GIF file. At present Turbo
>Pascal 5.5 is on the C: drive while FASTGIF and the *.GIF
>files are all on the D: drive in directory D:\GRAPHICS\GIF.

There are several things that can go wrong when tryin to call an
executable file from inside a TP program.  First, you need to
use the $M compiler directive to set a maximum heap size.  For
instance:
{$M 6000,0,10000}      
creates a 6K stack and a 10K heap and leaves room for other stuff.
Second, you should call SwapVectors before and after the Exec
statement.  Third, often you need to use a DOS call to make the
program work properly as is shown in the following:

{$M 6000,0,10000}
Procedure CallGIF;
Begin
  SwapVectors;
  Exec('\Command.Com','/C FASTGIF');
  SwapVectors;
End;

This assumes that '\Command.Com' is the correct path to your         
Command.Com file from wherever you are executing CallGIF.  If you
need to have the program find the correct path you can use the
GetEnv function: Path := GetEnv('COMSPEC');

guillory@storm.dnet.nasa.gov (Anthony R. Guillory (904)) (12/04/90)

Did you remember to use the $M directive to minimize the amount of RAM your
program takes up.  I have found that to be the key to using EXEC.  Otherwise
the EXEC documentation is pretty straight forward.

Anthony
Guillory@storm.dnet.nasa.gov