settagdata
settagdata
PAGE
,
PREFIX
,
SUFFIX
,
DATA
,
SEP

The settagdata statement changes the contents of a tag.

Parameters

This statement has five parameters:

page – text that may contain tag (must be a field or variable).

prefix – opening tag.

suffix – closing tag.

data – new text for tag contents.

sep – optional separator if we need to add this tag to page.

Description

This statement changes the contents of a tag.

For example, suppose a variable named Page contains this text within it.

    <NAME>Mark Wilson</NAME>

To change this name to John Smith, use this code.

    settagdata Page,"<NAME>","</NAME>","John Smith"

What if there wasn’t already a `<NAME></NAME>` tag pair? In that case, a new tag pair will be added at the end of the text in the variable. If you want to make sure this new tag pair is on a new line, add a separator parameter like this:

    settagdata Page,"<NAME>","</NAME>","John Smith",cr()

See Also

- gettaglocation -- locates the first matching tag within some text.
- gettaglocations -- locates all matching tags within some text.
- setxtagvalue -- changes the contents of a tag.
- tagarray( -- builds an array (see Text Arrays) containing the body of all the specified tags (usually HTML tags) in the text.
- tagcount( -- 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.
- tagdata( -- extracts the body of the specified tag (usually an HTML tag) in the text. See Tag Parsing for more information on HTML tags.
- tagend( -- returns the ending position of the specified tag (usually an HTML tag) in the text.
- tagnumber( -- checks to see if a specified position is inside of a tag (usually an HTML tag).
- tagparameter( -- extracts the value of a tag parameter embedded in some text, where the tag parameter takes the form *name=value*.
- tagstart( -- returns the starting position of the specified tag (usually an HTML tag) in the text.
- tagstrip( -- removes tags (usually HTML tags) from within a piece of text.
- xtag( -- generates an HTML/XML tag.
- xtagvalue( -- extracts the text from the first matching HTML or XML tag.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.