PSJ. - JSON Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > JSON - Parser > Parser-Operations > !Node Operations >

PSJ. - JSON Operations

PSJ.FreeTree

PreviousTopNext

 


SPR Script Language

 

PSJ.FreeTree

Frees a node and its subtree, releasing all associated resources.

 

Intention

 

The PSJ.FreeTree command in SPR releases a specified node identified by $$NODE along with its entire subtree, freeing all associated resources. It’s like telling your robot to uproot a specific branch and all its twigs from your JSON structure.

 

For example, freeing node 101 removes it and all its descendants from the document.

 

Illustration

📝 Free Subtree: PSJ.FreeTree|101 releases node 101 and its subtree.

 

Syntax

 

PSJ.FreeTree|$$NODE

 

Parameter Explanation

 

P1 - $$NODE - (Variable, Numeric)

The identifier of the node to free, along with its subtree (e.g., $$NODE as "101"). Must be a valid node. Required.

 

Examples

 

'***********************************

' Sample: Free a Node and Subtree

PSJ.FreeTree|101

' Releases node 101 and all its descendants

MBX.Cleanup Complete

 

Remarks

 

- This command does not return a value or indicate success/failure directly; it silently frees the specified node and its subtree.

- After execution, the node and its subtree are no longer accessible.

 

Limitations

 

- $$NODE must be a valid node identifier.

- Does not affect the document handle; use PSJ.Free to release the entire document.

 

See also:

 

PSJ.Free

PSJ.FreeAll