FindHtmlTag
Sub FindHtmlTag($source As String, $tagName As String, $paramName As String, ByRef $startPos As Integer, ByRef $length As Integer) As Boolean
Searches $source for the first occurrence of the HTML tag $tagName that contains the parameter $paramName.
FindHtmlTag is case-insensitive. The first character in $source has the position 1. If both $tagName and $paramName are found, FindHtmlTag returns TRUE.
Parameters
- $source ... String expression in which the search is performed.
- $tagName, $paramName ... String expressions. HTML tag and parameter to search for.
- $startPos ... Index of the tag start.
- $length ... Length of the found tag.
Example:
Dim $s, $iStart, $iLen
$s = "Click <a href=info.htm>here</a> for more information"
If FindHtmlTag($s, "a", "HREF", $iStart, $iLen) Then
' returns $iStart = 7, $iLen = 17
$s = Mid($s, $iStart, $iLen)
' returns $s = "<a href=info.htm>"
End If