zospy.functions.nce.find_object_by_comment

zospy.functions.nce.find_object_by_comment#

zospy.functions.nce.find_object_by_comment(nce: ZOSAPI.Editors.NCE, comment: str, case_sensitive: bool = True) list[_ZOSAPI.Editors.NCE.INCERow]#

Returns a list of objects from the NCE that have the supplied string as Comment.

In case of multiple matches, the objects are returned in ascending order.

Parameters:
nce: ZOSAPI.Editors.NCE

The Non-sequential Component Editor (NCE).

comment: str

String that is searched for in the Comment column of the NCE.

case_sensitive: bool=False

Flag that specifies whether the search is case-sensitive (default value) or not.

Returns:
list[ZOSAPI.Editors.NCE.INCERow]

A list of object in the NCE that have a Comment column value which matches the comment argument.

Examples

>>> import zospy as zp
>>> zos = zp.ZOS()
>>> zos.connect_as_extension()
>>> oss = zos.get_primary_system()
>>> oss.make_nonsequential()
>>> newobj1 = oss.NCE.InsertNewObjectAt(1)
>>> newobj1.Comment = 'aa'
>>> newobj2 = oss.NCE.InsertNewObjectAt(1)
>>> newobj2.Comment = 'bb'
>>> newobj3 = oss.NCE.InsertNewObjectAt(1)
>>> newobj3.Comment = 'aA'
>>> find_object_by_comment(oss.NCE, 'aa')