Please enable JavaScript to view this site.

ESL Documentation

Allow cleanup operation during termination.

 

void CleanUp ( int termcode        )

termcode

An integer value representing the termination code.  It has the following values:

 

Termination Code

Reason for Termination

TC_EXIT

The ExitLocalApp function was called or the function EslMain has returned.

TC_STOP

ESL executed a stop statement.

TC_ENDSESSION

The user is exiting Windows.

Include

LOCALAPP.H

Returns

No return value.

Description

This is an optional function that you may define within your local application. CleanUp is called just prior to termination of the local application.  If you do not define a CleanUp function, a stub version (which does nothing except return) contained in xLOCALAP.LIB is called instead.

By defining your own CleanUp function, you can ensure that any necessary cleanup operations, such as closing files or resetting devices, will be performed before the local application finally terminates.  This feature is especially useful when there is a possibility that ESL might terminate the local application, via the stop statement, without giving any advance warning.  The termination code termcode specifies why the termination is occurring.

Make sure your CleanUp function does not call any of the functions provided by xLOCALAP.LIB.  In other words, do not attempt to read any characters sent by ESL or send any characters to ESL inside of CleanUp.