dp4_halt()

Purpose

Exits the program

Old name

#define halt() dp4_halt(1)

Syntax

void dp4_halt(exit_code)

Parameters

int exit_code

Exit code to pass back to the operating system

Description

The function dp4_halt() is used to exit a DP4 program. You should use this function instead of exit(), otherwise your program may not close its connection to DP4 correctly. dp4_halt() first calls app_close() and only actually exits if app_close() returns a non zero value

The exit code is passed back to the operating system, so that programs calling the function dp4_halt() can be used in batch files, and in other applications where the exit code is required.

See also

app_close()

Example

/*
A serious error message might be implemented as
*/
void bad_error(int err)
{
map_pause(err);
dp4_halt(err);
}