The tagcount( function counts the number of times a specified tag (usually an HTML tag) appears in the text. See Tag Parsing for more information on HTML tags.
Parameters
This function has three parameters:text – is the item of text that contains the tags you want to count.
header – is the text that you want to use as a tag header. For example, if you want to count HTML tags, use "<"
as the header. If you wanted to count bold text items you would use "<B>"
as the header. (Note: Upper or lower case is ignored, so "<b>"
will also work.)
trailer – is the text that you want to use as a tag trailer. For example, if you want to count HTML tags, use ">"
as the trailer. If you wanted to count bold text items you would use"</B>"
as the trailer. (Note: Upper or lower case is ignored, so "</b>"
will also work.)
Description
This function returns the number of times the specified tag occurs in the text (it returns zero if the tag never occurs). (See Tag Parsing for more information on HTML tags.)
This example counts the number of tags on a page, assuming you have a field or variable named myPage that contains an HTML page.
message "This page contains "+tagcount(myPage,"<",">")+" tags."
This example counts the pictures on the page.
message "This page contains "+tagcount(myPage,"<img",")+" images."
See Also
History
Version | Status | Notes |
10.0 | No Change | Carried over from Panorama 6.0 |