Page History
...
Syntax
Code Block |
---|
Result = SRP_JSONJson(Handle, "RELEASERelease") |
Returns
Returns 1 if successful, 0 if not.
Parameters
Parameter | Description |
---|---|
Handle | Handle to a JSON Entity. Required. |
Remarks
The RELEASE Release service removes a JSON entity from memory. Once releasedReleased, it is no longer valid. In fact, the RELEASE Release service sets Handle to 0 to ensure the old handle will not be used accidentally. Any JSON entity created by the NEWNew or PARSEParse services must be deallocated from memory when no longer needed. Forgetting to do this on occasion will not cause a fatal error since SRP Utilities will clean up all its memory when OpenInsight closes, but frequently failing to release Release entities causes memory to get used up, which can become a problem over long periods of time.
Example
Code Block |
---|
// Let's create some entities. Success = SRP_JSONJson(ObjectHandle, "NEWNew", "OBJECTObject") Success = SRP_JSONJson(IntegerHandle, "NEWNew", "NUMBERNumber", "1234567890") Success = SRP_JSONJson(DecimalHandle, "NEWNew", "NUMBERNumber", "123456789.987654321") Success = SRP_JSONJson(StringHandle, "NEWNew", "STRINGString", "Hello, World!") Success = SRP_JSONJson(BooleanHandle, "NEWNew", "BOOLEANBoolean", 1) Success = SRP_JSONJson(ArrayHandle, "NEWNew", "ARRAYArray") // Don't forget to releaseRelease them when we're done SRP_JSONJson(ArrayHandle, "RELEASERelease") SRP_JSONJson(BooleanHandle, "RELEASERelease") SRP_JSONJson(StringHandle, "RELEASERelease") SRP_JSONJson(DecimalHandle, "RELEASERelease") SRP_JSONJson(IntegerHandle, "RELEASERelease") SRP_JSONJson(ObjectHandle, "RELEASERelease") |