Releases a previously instantiated COM object from memory.

Syntax

Result = SRP_Com(Object, "RELEASE")

Returns

1 if the object was released successfully, 0 if there was an error.

Remarks

The RELEASE service removes an instantiated object from memory. When you use the CREATE service to create objects, the GET service to get objects, or the CALL services for functions that return objects, they are loaded into memory and remain there until you either release the object using the RELEASE service or until OI closes down. If you forget to call this service; SRP_Com will clean up whatever is left, but it is best practice to release every object you create or get to avoid memory issues.

Example

// Instantiate the MSXML DOM Document object
If SRP_Com(objXmlDoc, "CREATE", "Msxml2.DOMDocument") then
    // Release the object when we're done with it
    SRP_Com(objXmlDoc, "RELEASE")
end else
    Error = SRP_Com("", "ERROR")
end