sys_fail()

Purpose

Produces a fail message

Old name

#define _vfail sys_fail

Syntax

void sys_fail(error, secon, addit)

Parameters

int error

DP4 error number

 

int secon

Operating system error

 

int addit

Additional error

Description

The sys_fail() function produces an error message on the screen and then terminates the program. The message takes the form:

Fail error reported by DP4 code <error>
Operating system error code <secon>
Additional error code <addit>
Error <error> or error message corresponding to it.
Operating system error: <secon> or error message corresponding to it

Press any key to continue

The output is the same as the DP4 FAIL utility.

Example

/*
C Functions Reference Manual
----------------------------
Filename: SYS_FAIL.C
Example: sys_fail
Purpose: Simple version of FAIL
*/
#include "dp4.h"
extern int atoi(char*);
void process(){
int n[3] = {0,0,0};
char* p;
int i;
for (i = 0; i < 3;i++)
{
if ((p = tail_read(TAIL_NOUCASE)) == 0)
break;
n[i] = atoi(p);
}
sys_fail(n[0],n[1],n[2]);