Technical References - [listwords]

Breaks a string of text into separate words.

numero = 268
interpreted = N
texte = [listwords Words]Some Text[/listwords] To display a list of all the separate words in a string, use a [listwords] context. You may optionally specify the delimiters defining the boundaries of words (usually spaces, commas, and periods). Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
[listwords Words=This is a big long sentence][index]: [word]
[/listwords]
The example above yields: 1: This 2: is 3: a 4: big 5: long 6: sentence
[listwords Words=Hello.      My name is Carl!&Delimiters= ,!][index]: [word]
[/listwords]
The example above yields the following. Notice the "." at the end of "Hello." is shown as part of the word, because "." was not specified in the list of delimiters. Also notice the long run of spaces in a row is collapsed and does not appear in the word list. 1: Hello. 2: My 3: name 4: is 5: Carl The following parameters are used in the [listwords] context:
ParameterDescription
words(Required) string of text to break up.
delimiters(Optional) List of single characters which define word boundaries. Defaults to space, comma, and dot.
tabs(Optional, Rare) Setting Tabs=T causes the list of words to break at tab boundaries only, and runs of tabs are not collapsed. This assists in parsing special formats where two tabs in a row are important and should not be skipped.
The following tags are available inside a [listwords] context:
TagDescription
[index]A number from 1 to the total number of words in the text indicating the word's index position in the text.
[word]Text of the word currently being displayed.
[delimiter]Text of the delimiter(s) which caused this word to break.
[break]From version 8.1, if the [listwords] context sees the [break] tag while executing, it will stop, once it finishes the current loop. Thus the [break] tag should only appear in a [showif] statement that is evaluated at the end (bottom) of the loop.
[listwords Words]Some Text[/listwords]

To display a list of all the separate words in a string, use a [listwords] context. You may optionally specify the delimiters defining the boundaries of words (usually spaces, commas, and periods).

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
[listwords Words=This is a big long sentence]
[index]: [word]

[/listwords]

The example above yields:

1: This
2: is
3: a
4: big
5: long
6: sentence

[listwords Words=Hello.      My name is Carl!&Delimiters= ,!]
[index]: [word]

[/listwords]

The example above yields the following. Notice the "." at the end of "Hello." is shown as part of the word, because "." was not specified in the list of delimiters. Also notice the long run of spaces in a row is collapsed and does not appear in the word list.

1: Hello.
2: My
3: name
4: is
5: Carl

The following parameters are used in the [listwords] context:

ParameterDescription
words(Required) string of text to break up.
delimiters(Optional) List of single characters which define word boundaries. Defaults to space, comma, and dot.
tabs(Optional, Rare) Setting Tabs=T causes the list of words to break at tab boundaries only, and runs of tabs are not collapsed. This assists in parsing special formats where two tabs in a row are important and should not be skipped.


The following tags are available inside a [listwords] context:

TagDescription
[index]A number from 1 to the total number of words in the text indicating the word's index position in the text.
[word]Text of the word currently being displayed.
[delimiter]Text of the delimiter(s) which caused this word to break.
[break]From version 8.1, if the [listwords] context sees the [break] tag while executing, it will stop, once it finishes the current loop. Thus the [break] tag should only appear in a [showif] statement that is evaluated at the end (bottom) of the loop.

DOWNLOAD WEBDNA NOW!

Top Articles:

Tips and Tricks

A list of user-submitted tips ...

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...

F.A.Q

A compilation of some user's questions...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

Related Readings:

[replacefounditems]

Replaces each found record in a database with the new field values...

[append]

[append db=base...

[sendmail]

There is hardly a website that doesn't at some point need to send an email...

[copyfile]

Copy a file with the content you want on your webspace...

[getchars]

Extracts a portion of the text (also known as substring or Mid$)...

[array]

Array Operation...