Routines for ema_eror.kb


CommonWrite

File Name

ema_eror.kb

Syntax

CommonWrite( VAL str:STRING, VAL strColor:INTEGER, REF errLogData:errLogDataRec, VAL newLine:BOOLEAN);

Parameters

str - string to write to log(s)

strColor - for the screen output, string color

errLogData - data return value

newLine - write a newline at end of str

Returns

-1 = unable to write to file

-2 = unable to write to window

-3 = unable to write to either window or file

1 = success

Side Effects

May write to file or window

Description

This function writes the supplied string to the log file, the log window, or both.

Dialog Forms Called

None


CreateLogFile

File Name

ema_eror.kb

Syntax

CreateLogFile( REF errLogData:ErrLogDataRec, VAL promptUserOnError:BOOLEAN, VAL closeCurrent:BOOLEAN, VAL fromStartup:BOOLEAN );

Parameters

errLogData - logging dialog box data structure

promptUserOnError - flag to put up a messsage box for errors

closeCurrent - flag to indicate that if a file is open, close it

fromStartup - perform any special startup activity

Returns

1 = success

0 = failure

-3 = target file is full

-2 = bad file name

-1 = see FOpen, operating system error code

Side Effects

None

Description

This routine creates the log window.

Dialog Forms Called

None


CreateLogWindow

File Name

ema_eror.kb

Syntax

CreateLogWindow( REF errLogData:ErrLogDataRec, VAL startMinimized:BOOLEAN, VAL displayLogFile:BOOLEAN );

Parameters

errLogData - logging dialog box data structure

startMinimized - flag to indicate the state of the window at creation

displayLogFile - if window is being created, this argument displays the Error file in the window

Returns

1 = success

2 = success (already created)

0 = failure

Side Effects

None

Description

This routine creates the errLog window.

Dialog Forms Called

None


DisplayLogFileInWindow

File Name

ema_eror.kb

Syntax

DisplayLogFileInWindow( REF logFile:FILE, VAL logFileName:STRING );

Parameters

logFile - file handle

logFileName - guess

Returns

None

Side Effects

None

Description

This routine places the existing error log file into the scrolling Log dialog box.

Dialog Forms Called

None


ErrLogCreateDialog

File Name

ema_eror.kb

Syntax

ErrLogCreateDialog( VAL parentWindow:WINDOW );

Parameters

parentWindow - window handle of the parent for a new dialog box

Returns

2 = already up

1 = success

0 = failure

Side Effects

None

Description

This function creates a dialog box of type log. Before calling this function, you should always call ErrLogGetData on your first argument, and override any necessary values. Failure to call GetData results in the normal defaults not being applied.

Dialog Forms Called

None


ErrLogDBEnableControls

File Name

ema_eror.kb

Syntax

ErrLogDBEnableControls( VAL enableControls:BOOLEAN, VAL msgString:STRING, VAL mailData:EMailDataRec );

Parameters

enableControls - TRUE (enable) or FALSE (disable)

msgString - string to write to the message line in the box (if there is one).

Nothing is written if this is $Unknown.

mailData - mail data for use by the 'GetReadCount' button

Returns

1 = success

0 = failure

Side Effects

None

Description

This function enables or disables the user controls and outputs a string to the message line (if there is one).

Dialog Forms Called

None


ErrLogDBErrorFatal

File Name

ema_eror.kb

Syntax

ErrLogDBErrorFatal( VAL dbErrorCode:INTEGER );

Parameters

dbErrorCode - the (negative) SQL return code

Returns

None

Side Effects

None

Description

This routine looks at the database error code (presumably a return value from a database call) and attempts to determine the severity of the error, returning TRUE if the error indicates that further database activity would be useless.

Dialog Forms Called

None


ErrLogDlgRestoreData

File Name

ema_eror.kb

Syntax

ErrLogDlgRestoreData( REF errLogData:ErrLogDataRec );

Parameters

ErrLogData - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function restores the dialog box data associated with this module from a file or database.

Dialog Forms Called

None


ErrLogEventHandler

File Name

ema_eror.kb

Syntax

ErrLogEventHandler( REF errLogDlgData:ErrLogDlgDataRec);

Parameters

errLogDlgData - instance data for this dialog box type

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine provides event handling for the Log dialog box.

Dialog Forms Called

None


ErrLogHideDialog

File Name

ema_eror.kb

Syntax

ErrLogHideDialog;

Parameters

None

Returns

1 = success

0 = failure

Side Effects

None

Description

This function hides the dialog box for this KB. It destroys the GUI, but leaves the data structure intact.

Dialog Forms Called

None


ErrLogInitData

File Name

ema_eror.kb

Syntax

ErrLogInitData;

Parameters

None

Returns

1 = success

0 = failure

Side Effects

None

Description

This function initializes the module data structure with information in the external data store.

Dialog Forms Called

None


ErrLogShutDown

File Name

ema_eror.kb

Syntax

ErrLogShutDown( VAL callerstatus:INTEGER );

Parameters

callerStatus - caller's shutdown status

Returns

1 = success

0 = failure

Side Effects

None

Description

This function performs the final operations for this module in the expectation that the calling application is shutting down. If caller is closing down due to internal probs, then this module should probably abort.

Dialog Forms Called

None


ErrLogTestDialog

File Name

ema_eror.kb

Syntax

ErrLogTestDialog(VAL args:LIST OF STRING);

Parameters

args - command line argument list

Returns

1 = success

0 = failure

Side Effects

None

Description

This procedure is called if this module is executed directly. Its function is to bring up the dialog box for interaction and to make calls to the public interface to this module.

Dialog Forms Called

None


ErrLogWrite

File Name

ema_eror.kb

Syntax

ErrLogWrite( VAL str:STRING, VAL strColor:INTEGER);

Parameters

str - string to write to log(s)

strColor - for the screen output, string color

Returns

-1 = unable to write to file

-2 = unable to write to window

-3 = unable to write to either window or file

1 = success

Side Effects

May write to file or window

Description

This function writes the supplied string to the log file, the log window, or both. This function does not add a newline character at the end of str, like ErrLogWriteLn.

Dialog Forms Called

None


ErrLogWriteDBError

File Name

ema_eror.kb

Syntax

ErrLogWriteDBError( VAL msgString:STRING, VAL routineName:STRING, VAL dbFunction:STRING, VAL dbTable:STRING, VAL dbErrorCode:INTEGER, VAL strColor:INTEGER);

Parameters

msgString - string to write to error log(s)

routineName - routine where error occurred

dbFunction - function being performed when error occurred

dbTable - table being accessed when error occurred

dbErrorCode - database error code

strColor - for the screen output, string color

Returns

-1 = unable to write to file

-2 = unable to write to window

-3 = unable to write to either window or file

0 = write not enabled

1 = success

Side Effects

May write to file or window

Description

This function writes the supplied information to the error log. It is geared to writing output for database errors.

Dialog Forms Called

None


ErrLogWriteLn

File Name

ema_eror.kb

Syntax

ErrLogWriteLn( VAL str:STRING, VAL strColor:INTEGER);

Parameters

str - string to write to log(s)

strColor - for the screen output, string color

Returns

-1 = unable to write to file

-2 = unable to write to window

-3 = unable to write to either window or file

1 = success

Side Effects

may write to file or window

Description

This function writes the supplied string to the log file, the log window, or both. This function includes a newline character at the end of str.

Dialog Forms Called

None


ErrLogWriteSysError

File Name

ema_eror.kb

Syntax

ErrLogWriteSysError( VAL msgString:STRING, VAL routineName:STRING, VAL sysFunction:STRING, VAL sysErrorCode:INTEGER, VAL strColor:INTEGER);

Parameters

msgString - string to write to error log(s)

routineName - routine where error occurred

strColor - for the screen output, string color

Returns

None

Side Effects

May write to file or window

Description

This function writes the supplied information to the error log. It is set up to write any system error code.

Dialog Forms Called

None


ErrModuleTestEventHandler

File Name

ema_eror.kb

Syntax

ErrModuleTestEventHandler(REF errModuleTestData: ErrModuleTestRec);

Parameters

ErrModuleTestData - instance data for this dialog box type

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine provides event handling for the ErrModuleTest dialog box.

Dialog Forms Called

None


PerformAction

File Name

ema_eror.kb

Syntax

PerformAction( REF errLogDlgData:ErrLogDlgDataRec, VAL dlgHandle:WINDOW, VAL controlName:STRING, VAL controlID:INTEGER );

Parameters

errLogDlgData - the instance data for this window

dlgHandle - window handle of dialog box

controlName - name of the control selected

controlID - number ID of the control selected

$EventParm(3,T) - old value of the object

$EventParm(4,T) - new value of the object

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine performs actions for controls in the Logging Configuration dialog box.

Dialog Forms Called

None


PlaceholderEvent

File Name

ema_eror.kb

Syntax

PlaceholderEvent;

Parameters

None

Returns

None

Side Effects

None

Description

This routine provides minimal event handling for the scrolling log dialog box.

Dialog Forms Called

None


TransferAttribsToModuleRec

File Name

ema_eror.kb

Syntax

TransferAttribsToModuleRec(VAL errLogAttribList:LIST OF DBDialogAttribRec);

Parameters

errLogAttribList - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function transfers the DB attributes list to the module data structure.

Dialog Forms Called

None


TransferModuleRecToAttribs

File Name

ema_eror.kb

Syntax

TransferModuleRecToAttribs(REF errLogAttribList:LIST OF DBDialogAttribRec);

Parameters

errLogAttribList - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function transfers the module data structure contents database attributes list for transmission to the database.

Dialog Forms Called

None