# SetBreakOnLibraryErrors

SetBreakOnLibraryErrors (int newState);

## Purpose

When you enable debugging and a National Instruments library function reports an error, LabWindows/CVI can display a run-time error dialog box and suspend execution. You can use SetBreakOnLibraryErrors to enable or disable this feature.

In general, use the Break on»Library Errors command in the Workspace window to enable or disable this feature. Use this function only when you want to temporarily disable the Break on»Library Errors feature around a segment of code. This function changes the setting for the thread that calls this function.

SetBreakOnLibraryErrors does not affect the state of the Break on»Library Errors option in the Workspace window.

If you disable run-time checking, SetBreakOnLibraryErrors has no effect. LabWindows/CVI never reports run-time errors when you disable run-time checking. Run-time checking is enabled when you set the debugging level in the Build Options dialog box of the Workspace window to Standard or Extended, and you select Build»Configuration»Debug.

### Example

int oldValue;
oldValue = SetBreakOnLibraryErrors (0);
/* Function calls that may legitimately return errors. */
SetBreakOnLibraryErrors (oldValue);

## Parameters

Input
Name | Type | Description
newState | integer | Determines whether LabWindows/CVI displays a runtime error dialog box when a National Instruments library function reports an error, if debugging is enabled. Pass a nonzero value to enable. Pass zero to disable. If debugging is disabled, this parameter has no effect.

## Return Value

Name | Type | Description
oldState | integer | Previous state of the Break on library errors option.
Code | Description
1 | Previously enabled.
0 | Previously disabled, or debugging is disabled.