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

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com