# ReturnRS232Err

int ReturnRS232Err (void);

## Purpose

Returns the error code from the most recent function call in the current thread. If the most recent function call was successful, ReturnRS232Err returns zero.

| Note If the most recent function call was successful but an asynchronous write operation failed, ReturnRS232Err returns the error code from the asynchronous operation. If you want to make sure that a particular function call succeeded, use the return value from that function call.

ReturnRS232Err is multithread safe. Using the rs232err global variable is not multithread safe.

If this function returns -1, call GetRS232ErrorString to obtain a Windows system message.

## Parameters

None.

## Return Value

Name | Type | Description
result | integer | Error code from the most recent function call in the current thread. If the most recent function call was successful, the value is zero.
| Note If the most recent function call was successful but an asynchronous write operation failed, ReturnRS232Err returns the error code from the asynchronous operation. If you want to make sure that a particular function call succeeded, use the return value from that function call.
If the error code is -1, call GetRS232ErrorString to get a Windows system message.