Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Append Syntax 1 – PB Docs 126 – PowerBuilder Library

Append Syntax 1 – PB Docs 126

PBDOM_CHARACTERDATA:

Append Syntax 1 method

Description

Appends
an input string to the text content that already exists within the
current PBDOM_CHARACTERDATA object.

Syntax

Argument

Description

pbdom_text_name

The name of a PBDOM_CHARACTERDATA
object

strAppend

The string you want appended to the existing
text of the current PBDOM_CHARACTERDATA object

Return Values

PBDOM_CHARACTERDATA. The current PBDOM_CHARACTERDATA modified
and returned as a PBDOM_CHARACTERDATA object.

Throws

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE – If
this PBDOM_CHARACTERDATA object is not a reference to an
object derived from PBDOM_CHARACTERDATA.

Examples

In this example, the PowerScript code builds a PBDOM_DOCUMENT
based on the following DOM Tree:

The root element abc has a child element, data,
that has three child elements. child_1 contains
a child PBDOM_TEXT with the string “My Text”. child_2 contains
a child PBDOM_COMMENT with the string “My Comment”. child_3 contains
a child PBDOM_CDATA with the string “My CDATA”.

In the following PowerScript code, the single statement that
follows the comment // obtain
the child PBDOM_TEXT of child_1
does
the following:

  1. Obtains the
    root element of the PBDOM_DOCUMENT pbdom_doc using GetRootElement.
    A new PBDOM_ELEMENT representing the root element abc is
    created in memory and returned.

  2. Calls the GetChildElement method
    on the returned root abc PBDOM_ELEMENT
    using data as the parameter to single out the data child element.
    A PBDOM_ELEMENT representing the data element is created
    in memory and returned.

  3. Calls the GetChildElement on
    the returned data PBDOM_ELEMENT, using child_1 as
    the parameter to single out the child_1 child
    element. A PBDOM_ELEMENT representing the child_1 element
    is created in memory and returned.

  4. Calls the GetContent method on
    the returned child_1 PBDOM_ELEMENT,
    supplying a reference to the unbounded array pbdom_chardata_array.

    You can supply PBDOM_CHARACTERDATA array instead
    of a PBDOM_OBJECT array because PBDOM_CHARACTERDATA
    is a subclass of PBDOM_OBJECT. However, GetContent fails
    if child_1 contains any objects other than PBDOM_CHARACTERDATA
    objects.

Because child_1 holds only the
PBDOM_TEXT containing the string “My Text”,
this statement returns an array that has only one array item. The
next statement appends another string to the array item. The example
then repeats these steps for child_2 and child_3 and
saves pbdom_doc to a file:

The saved file contains the following:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x