|The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....|
|Home BasePack HTMLSupport Procedures and Functions CountWordsHTML|
|See also: CountCharInString, CountWords|
The function CountWordsHTML returns the number of words in the string InString. In contrast to CountWords this function does not include HTML tags and resolves any HTML entities before counting the words. Thus it is ideally suited to count words in HTML text.
Words are recognized by using the list of word separators defined in the public constant WordSeps. The minimum required length of a word is two characters.
Upon entry of the function the parameter OpenHTMLTag indicates whether the first words in the string belong to an open HTML tag (which has been opened in a previous string). On return, OpenHTMLTag is set to TRUE if the last word is part of an HTML tag which has not been closed within the string InString. This mechanism allows to correctly process HTML tags which span over several lines.