Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!hsdndev!husc6!popvax!rind From: rind@popvax.uucp (747707@d.rind) Newsgroups: comp.lang.pascal Subject: Re: EXEC GIF files from within Turbo Pascal 5.5 Keywords: GIF, EXEC Message-ID: <4908@husc6.harvard.edu> Date: 4 Dec 90 10:23:20 GMT References: <7622@hub.ucsb.edu> Sender: news@husc6.harvard.edu Distribution: comp Organization: Health Sciences Computing Facility, Harvard University Lines: 30 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'); Brought to you by Super Global Mega Corp .com