Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!elroy.jpl.nasa.gov!sdd.hp.com!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclapd!defaria From: defaria@hpclapd.cup.hp.com (Andy DeFaria) Newsgroups: comp.lang.pascal Subject: Process handling/Memory and Ctrl-C Message-ID: <950053@hpclapd.cup.hp.com> Date: 15 Jan 91 00:51:06 GMT Organization: Hewlett-Packard Calif. Language Lab Lines: 29 Why do I get the following error messages? The following program allocates the smallest stack possible (1024) then Exec's SORT. I then hit Control-C to abort the SORT operation and fail with the following two errors: Runtime error 202 at 0010:09B9 { 202 = Stack overflow error } Runtime error 105 at 0000:00D8 { 105 = File not open for output } In a similar vein: How can I release all memory used by my program to whatever program I Exec and still be able to reclaim the memory back once the Exec'ed program is finished? I would like to allow any program that I start to have access to as much memory as is available to avoid potential problems. {$M 1024, 0, 0} Program Foo; Uses DOS; Begin { Foo } WriteLn ('Executing C:\SYSTEM\DOS\SORT.EXE'); Exec ('C:\SYSTEM\DOS\SORT.EXE'); If DOSError <> 0 then WriteLn ('DOSError = ', DOSError : 1) else WriteLn ('Successful'); End. { Foo }