Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Keep Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Argument
code Integer expression representing the exit code to pass to
the parent process or operating system
Description
The Keep procedure terminates a program but keeps it resident in
memory as a terminate-and-stay-resident (TSR) program. Call Keep at
the end of the program.
The code argument passes exit information from the terminated
program to the program executing it or to the DOS environment. By
convention, 0 means no error. However, it is up to the terminating
program to establish a meaning for each error value.
To ensure enough memory for later programs, use the {$M} directive
at the beginning of the program. Since the entire program and all
of its associated memory──data segment, stack segment, heap──are
kept resident, set the stack and heap to the minimum settings
needed.
TSR programs are an advanced and unsupported programming
technique. No other documentation is provided with QuickPascal.
Do not run a TSR program within the QuickPascal environment.