QTP-XML service functions (5) – ChildCommentValue

Categories: Source codeXML Data

Parent page: Service Functions – XML (QTP, VBScript)

Description

Retrieves child comment node from comments collection and returns comment text as string.

Public Function ChildCommentValue(ByRef objXMLParent, ByVal intNumber)
	Dim objColl, objComment
	If objXMLParent is Nothing Then
		ChildCommentValue = ""
		Exit Function
	End If
	Set objColl = objXMLParent.Comments()
	If intNumber > objColl.Count Then
		ChildCommentValue = ""
		Exit Function
	End If
	ChildCommentValue = objColl.Item(intNumber)
End Function

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by the author is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.