Information: Do discards the {class} this call returns
Do runs the call and drops its value, which for a %Status or %Boolean return is the
callee’s report of whether it worked: the caller goes on as if it had. IRIS compiles and
runs the call. Where the outcome matters, Set sc = ..Save(...) followed by $$$ISERR(sc),
or If ..Save(...), puts the result to use; where it does not, the Do is a choice, not a
mistake, and the usual one: IRIS’s own classes write streams and collections this way, so
this is information, not a warning.
IRIS compiles the example.
Class Demo.DiscardedReturnValue
{
ClassMethod Save(name As %String) As %Status
{
Set ^Demo.Names(name) = $Horolog
Quit $$$OK
}
ClassMethod Call()
{
Do ..Save("Ann") //! A4556
}
}