Technical References - [countwords]

The number displayed is the number of words inside the context

numero = 219
interpreted = N
texte = [CountWords]Any Text[/CountWords] Counts the number of words inside the context. To count the number of words in something, put the text inside a [CountWords] context. Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
[countwords delimiters= ,]This is a big long sentence, don't you think?[/countwords]
In the example above, the displayed text will be: 9 The number displayed is the number of words inside the context -- the number of words found depends on the delimiters you specify. If you specify spaces, commas, and periods as delimiters, then those characters will not be counted, and words will be defined as any text that is not a delimiter. Long runs of delimiters are ignored, so more than one space between words will not increase the word count.

If you want to count the number of lines in a multi-line string (such as the number of paragraphs in a story,) you can specify carriage return as the delimiter

[countwords delimiters=%0D]first linesecond linethird line[/countwords]
This will return 3, where the 'words' are actually defined as whole lines of text. Blank lines do not count. %0D is the hexadecimal equivalent to carriage return. You could type a carriage return in the Delimiters parameter, but for formatting reasons in this document we use the equivalent hexadecimal notation.

[countwords]Any Text[/CountWords]
Counts the number of words inside the context.
To count the number of words in something, put the text inside a [countwords] context.

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):

[countwords delimiters= ,]This is a big long sentence, don't you think?[/countwords]

In the example above, the displayed text will be:

9

The number displayed is the number of words inside the context -- the number of words found depends on the delimiters you specify. If you specify spaces, commas, and periods as delimiters, then those characters will not be counted, and words will be defined as any text that is not a delimiter. Long runs of delimiters are ignored, so more than one space between words will not increase the word count.

If you want to count the number of lines in a multi-line string (such as the number of paragraphs in a story,) you can specify carriage return as the delimiter


[countwords delimiters=%0D]first line
second line
third line
[/countwords]

This will return 3, where the 'words' are actually defined as whole lines of text. Blank lines do not count. %0D is the hexadecimal equivalent to carriage return. You could type a carriage return in the Delimiters parameter, but for formatting reasons in this document we use the equivalent hexadecimal notation.


DOWNLOAD WEBDNA NOW!

Top Articles:

Tips and Tricks

A list of user-submitted tips ...

Download WebDNA Applications

WebDNA applications...

F.A.Q

A compilation of some user's questions...

WebDNA reference

...

WebDNA Libraries

A list of available libraries for WebDNA...

[biotype]

BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...

Related Readings:

triggers

Triggers provide a mechanism for doing something on a regular timed basis...

[cookie]

Cookies are a great way to remember visitors...

Database format

...

[SQLdisconnect]

...

[math]

[math] calculates equations using numbers...

[writefile]

[writefile] functions allows you to perform a wide variety of tasks...