Description
Returns true if the GNML tag strTag exists in strParaCmdString.
Usage: bResult = HasTagInString(">hld")
Syntax
bResult = HasTagInString(strParaCmdsString, strTagName) |
strParaCmdsString
string that contains GNML tags, usually provided by Text.GetTxt after all paragraph and tags were selected, or by
strTagName
tag name with or without tag brackets. Add brackets for an exact match.
Code
Function HasTagInString(ByVal strString, ByVal strTag)
' Purpose: Returns true if the GNML tag strTag exists in strParaCmdString
' Usage: bResult = HasTagInString(">hld")
' strTag may end with a space or with < or with any other char
HasTagInString = False
If InStr(strString, strTag) > 0 Then
If Right(strTag, 1) = " " Then ' parameter was ">co "
HasTagInString = True
Exit Function
End If
If Right(strTag, 1) = "<" Then ' parameter was ">co<"
HasTagInString = True
Exit Function
End If
If InStr(strString, strTag + "<") > 0 Then ' parameter was ">co" and command is >co<
HasTagInString = True
Exit Function
End If
If InStr(strString, strTag + " ") > 0 Then ' parameter was ">co" and command is >co value<
HasTagInString = True
Exit Function
End If
End If
End Function
See also
HasTagInPara, HasTag, sysHasParaTags