| AHELP for CIAO 4.5 ChIPS v1 | get_error_count |
Context: errors |
Synopsis
Retrieves the number of instances of the specified ChIPS error type.
Syntax
get_error_count(error_type)
Description
- error_type - Returns the count of errors and/or warnings.
The get_error_count command retrieves the count of the number of ChIPS errors since the last legal ChIPS command. This command is part of the advanced ChIPS module; refer to "ahelp chips" for information. To load the module:
from pychips.advanced import *
The single argument can take one of three values: 0, 1, or 2:
| Argument Value | Description |
|---|---|
| 0 | Show the sum of both Errors and Warnings |
| 1 | Show the count of Errors only |
| 2 | Show the count of Warnings only |
The value returned is the number of errors of the requested type. Once the user issues a legal command (other than the get_error_ and set_error_ commands), the error count is reset to zero. The error statistics collected refer to ChIPS internal error only. For example, if the user mispells an attribute, this will count as a ChIPS error. If the user mispells a ChIPS command, Python will return an error saying the command is not defined, and this will not be counted in the error count.
Example
chips> set_preference ("curve.err.right", "tre");
chips> get_error_count(0)
chips> get_error_count(1)
chips> get_error_count(2)
chips> set_preference ("curve.err.right", "tre");
chips> get_error_count(0)
chips> get_error_count(1)
chips> get_error_count(2)A valid command, with an incorrect attribute value, is issued to Chips. This results in an error which is displayed. Three get_error_count commands are issued with arguments 0,1, and 2. As the problem is an error, the count for an argument of 0 (all), is 1, the count for an of argument 1 (errors only) is one, and the count for an argument value of 2 (warnings) is 0. The same command, complete with the invalid attribute, is issued again, and as the command is recognized, the error count is reset.

![[ChIPS Logo]](../imgs/chips_logo_navbar.gif)