op_stat_valid()
Abstract
Checks that the statistic handle is valid.
Syntax
op_stat_valid (shandle)
| Argument | Type | Description |
|---|---|---|
shandle |
Stathandle |
Statistic handle that identifies a global or local statistic. [A statistic handle can be obtained with the KP op_stat_reg().] |
Return Type
Boolean
The constant OPC_TRUE is returned if the handle is valid. The constant OPC_FALSE is returned if the handle is not valid.
Example
void write_stat(stathandle sh, double val)
{
if (op_stat_valid (sh) == OPC_TRUE)
{
/* ... appropriate additional tests, code... */
op_stat_write(sh, val);
}
}
Details
The KP op_stat_valid() confirms that a statistic handle is valid.
A common use of this KP is to limit the processing of local and global statistics. Only the statistics that were enabled with check boxes by the user in the View Results window return an OPC_TRUE value to the application; check boxes that were not selected return an OPC_FALSE value. Consequently, the application processes only the data from the statistic handles that were validated (TRUE). This increases computing efficiency and shortens processing time.
Purpose
To validate the statistic handle.
Errors
None.
Reference
- Use the KP op_stat_reg() to obtain a statistic handle