DeleteNode Method (XDATA)


9.8A

 

The DeleteNode method. The method uses the following format:

 

[label]

{object}.DeleteNode

[GIVING {return}] USING *Position={position}

Where:

label
Optional. A Program Execution Label.
object
Required. An XDATA object.
return
Optional. A Numeric Variable that receives a value to signify a pass or fail condition for the method execution.
position
Required. A Numeric Variable or decimal number that specifies the position in the node tree where the node is deleted.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The ZERO flag is set if the {return} value is zero.

  2. The OVER flag is set TRUE if the {return} variable is too small where the returned value is truncated.

  3. The EOS flag is always cleared.

  4. The {position} values are defined as follows:

  5.  

    Keyword

    Value

    Meaning...

    DELETE_CURRENT_NODE

    0

    Delete the current node and all of its children.

    DELETE_PARENT_NODE

    1

    Delete the parent node and all of its children.

    DELETE_FIRST_CHILD

    2

    Delete the first child node and all of its children.

    DELETE_LAST_CHILD

    3

    Delete the last child node and all of its children.

    DELETE_PREVIOUS_SIBLING

    4

    Delete the previous sibling node and all of its children.

    DELETE_NEXT_SIBLING

    5

    Delete the next sibling node and all of its children.

    DELETE_DOCUMENT_NODE

    6

    Delete the document node and all the children.

     

  6. The {return} value is a zero if the method execution is successful. Otherwise, a non-zero value is returned to indicate an error has occurred. See the XDATA Method Return Values for more details.

  7. This method can return these values:

  8.  

    Value

    Meaning

    0

    XDATA_ERR_NONE (Success)

    1

    XDATA_ERR_NO_MEM

    2

    XDATA_ERR_INVALID_POSITION_TYPE

    11

    XDATA_ERR_INVALID_POSITION

Example:

 

xData

XDATA

 

.

 

 

 

xData.Delete GIVING result

 

 

See Also: XDATA, XDATA Methods, Method Syntax



PL/B Language Reference CreateText Method (XDATA) FindNext Method (XDATA)