Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For indexed parameters, simply pass the requisite index values immediately following the Name parameter. Note that this is different from OpenInsight's Get_Property method, in which indexes are passed within square brackets following the property name. For example, you might get the first item of a property using OpenInsight's Get_Property like so:

...

Code Block
Value = Get_Property(Ctrl, "Items[1]")

...

The same code using SRP_Com looks like this:

Code Block

...

Value = SRP_Com(Ctrl, "GET", "Items", 1)

...

Note also that, unlike the other services, the GET service does not have a success/failure return value. Instead, it simply returns the property value. You can still use the ERROR service to determine if there was an error, particularly if an unexpected null value is returned.

Some properties return references to new objects. In this case, the return value is a new object handle, which you may use with SRP_Com to "drill down" into the returned object's properties and methods. The example below shows what this looks like.

Example

...

Code Block
// Instantiate the MSXML DOM Document object
If SRP_Com(objXmlDoc, "CREATE", "Msxml2.DOMDocument") then
    // Load the xml
    rv = SRP_Com(objXmlDoc, "CALL", "loadXML", Xml)
    // Check for a parsing error by getting the ParseError object
    objParseError = SRP_Com(objXmlDoc, "GET", "ParseError")
    If SRP_Com(objParseError, "GET", "ErrorCode") then
        Error = SRP_Com(objParseError, "GET", "Reason")
    end else
        // Parsing succeeded
    end
    // Release the ParseError object we got earlier
    rv = SRP_Com(objParseError, "RELEASE")
    // Release the object when we're done with it
    SRP_Com(objXmlDoc, "RELEASE")
end else
    Error = SRP_Com("", "ERROR")
end