Function FindEquipmentByTag( ByRef sTag$, ByVal nType&, _
ByRef hHandle ) As Long
Purpose: Find next object that has the tag in its tag string.
Works in: OneLiner and Power Flow.
Parameters:
sTag [in] Tag string
nType [in] Equipment type. This parameter can be one of the followings: TC_BUS, TC_LOAD, TC_SHUNT, TC_GEN , TC_SVD, TC_LINE, TC_XFMR, TC_XFMR3, TC_PS, TC_SCAP, TC_MU, TC_RLYGROUP, TC_RLYOCG, TC_RLYOCP, TC_RLYDSG, TC_RLYDSP, TC_FUSE, TC_SWITCH, TC_RECLSRP, TC_RECLSRG or zero.
nHandle [out] Object handle
Return value:
1 success
0 failure
Remarks: To get the first object in the list, call this function with nHandle equal 0. Call this function with nType equal 0 to search all object types.
Example:
Sub main
ObjHnd& = 0
While FindEquipmentByTag( "Line tag", TC_XFMR, ObjHnd ) > 0
If EquipmentType( ObjHnd ) = TC_RLYGROUP Then
RelayHnd& = 0
While GetRelay( ObjHnd, RelayHnd ) > 0
Print "Memo: " + GetObjMemo( RelayHnd ) + _
Chr(13) + Chr(10) + "Tags: " + GetObjTags( RelayHnd )
Wend
Else
Print "Memo: " + GetObjMemo( ObjHnd ) + _
Chr(13) + Chr(10) + "Tags: " + GetObjTags( ObjHnd )
End If
Wend
Exit Sub
HasError:
Print "Error: ", ErrorString( )
End Sub