PSJ. - JSON Operations

<< Click to Display Table of Contents >>

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

PSJ. - JSON Operations

Document Operations

TopNext


SPR Script Language

 

Document Operations

Commands for managing entire JSON documents in the SPR Script Language.

 

Intention

 

The Document Operations chapter groups commands in the PSJ. library that are designed to manage entire JSON documents. These commands enable users to duplicate, merge, parse, reset, and free document handles, providing high-level control over the lifecycle of JSON documents. This section is intended for users who need to handle complete JSON structures as a whole.

 

For example, duplicating a document or merging two documents can be achieved using these commands, facilitating the management of entire JSON datasets.

 

Illustration

📝 Duplicate a Document: PSJ.DupDoc|docHandle|$$NEWDOC creates a duplicate of the specified document and stores the new handle in $$NEWDOC.
📝 Merge Documents: PSJ.MergeDocs|docHandle1|docHandle2|$$MERGED merges two documents and stores the result in $$MERGED.

 

Commands

 

PSJ.DupDoc - Creates a duplicate of an entire JSON document.

PSJ.Free - Frees a specific JSON document handle from memory.

PSJ.FreeAll - Frees all JSON document handles from memory.

PSJ.MergeDocs - Merges two JSON documents into a single document.

PSJ.Parse - Parses a JSON string and creates a document handle.

PSJ.Reset - Resets the JSON library state to its initial condition.

 

Remarks

 

- All document operations require a valid document handle where applicable.

- Commands like PSJ.DupDoc and PSJ.MergeDocs handle document-level duplication and merging, while PSJ.Free and PSJ.Reset manage resource cleanup.

 

See also:

 

Array Operations

Object Operations

Node Operations

Value Operations