Method

Description

Parameter

Return Values

 

 

 

 

GetPreviousError

Moves the error data pointer to

void

TRUE—If successful

 

the previous error in the list.

 

FALSE—If no

 

 

 

 

 

 

previous error

 

 

 

exists.

 

 

 

 

GetFirstError

Moves the error data pointer to

void

TRUE—If successful

 

the first error in the list.

 

FALSE—If no error

 

 

 

 

 

 

is found.

 

 

 

 

GetLastError

Moves the error data pointer to

void

TRUE—If successful,

 

the last error in the list.

 

otherwise FALSE.

 

 

 

 

GetMsgID

Retrieves the message of the

void

Return Value:

 

current error data block.

 

Pointer to a message

 

You must call one of the

 

ID if data block is

 

 

value.

 

GetXXXXError methods before

 

 

 

calling this method in order to

 

 

 

retrieve the proper results.

 

 

 

 

 

 

GetFeedBackCode

Returns the feedback code of the

void

Feedback code.

 

current error data block.

 

 

 

 

 

 

GetReturnCode

Returns the Sterling

void

One of the valid

 

Connect:Direct return code.

 

Sterling

 

 

 

Connect:Direct

 

 

 

return code: 1,4,8,16.

 

 

 

 

GetStatus

Returns the status.

void

Sterling

 

 

 

Connect:Direct

 

 

 

status code.

 

 

 

 

GetSubstitute

Returns the current substitution

void

Pointer to a

 

buffer associated with the error.

 

substitution buffer.

 

 

 

 

DisplayError

Displays the current error chain

Parameters:

Return Value:

 

to an output location.

Pointer to a

Returns the highest

 

 

file I/O

error found in the

 

 

structure.

error chain or -1 on

 

 

 

error.

 

 

 

 

Following is the ConnectDirectSession class header:

#include <stdio.h>

//Error enumeration.

typedef enum CDErrorCode

{

CD_SUCCESS = 0, CD_FAILURE = -1

} CDErrorCode;

//<<Interface>> class CDSession

{

public:

//Communication methods...

virtual CDErrorCode Connect(void) = 0;

virtual CDErrorCode Connect(char *IpAddress, char *IpPort) = 0; virtual CDErrorCode DisConnect(void) = 0;

virtual CDErrorCode SendCommand(char *CmdText) = 0; virtual CDErrorCode ReceiveResponse(void) = 0;

72Sterling Connect:Direct for UNIX: User Guide

Page 78
Image 78
IBM 4J manual Following is the ConnectDirectSession class header, Cdsuccess = 0, Cdfailure =