The number displayed is the number of words inside the context
numero = 219[countwords delimiters= ,]This is a big long sentence, don't you think?[/countwords]In the example above, the displayed text will be:9The 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]
[countwords delimiters= ,]This is a big long sentence, don't you think?[/countwords]
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]
DOWNLOAD WEBDNA NOW!
A list of user-submitted tips ...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
F.A.QA compilation of some user's questions...
Download WebDNA ApplicationsWebDNA applications...
WebDNA LibrariesA list of available libraries for WebDNA...
Modify an existing line item in an order file...
[sendmail]There is hardly a website that doesn't at some point need to send an email...
[SQLconnect]Opens and persists a 'named' connection to a SQL server...
[calcfilecrc32]calculates the CRC32 value of a given file...
[function]This context enables the WebDNA programmer to call a previously defined block of WebDNA code...
[showif][showif Comparison]Show This HTML[/showif]...