ReturnObject and ReturnInfoObject (Daemon subroutines)

From m204wiki
Revision as of 02:49, 14 March 2011 by Goff (talk | contribs) (match syntax table to syntax template (will need to be redone when syntax template is fixed) tags and edits)
Jump to navigation Jump to search

Specify objects returned to the master thread (Daemon class)

ReturnObject and ReturnInfoObject specify the output objects to be returned to the master thread. The difference between them is that ReturnObject returns the value of the (unnamed) third argument of the Run function, while ReturnInfoObject returns the value of the named Info object of the Run function.

Syntax

%(Daemon):ReturnObject( outputObj)

%(Daemon):ReturnInfoObject( outputObj)

Syntax terms

%(Daemon) The class name in parentheses denotes a shared method. ReturnObject and ReturnInfoObject can also be invoked via a Daemon object variable, which may be null.
%outputObj The object returned from the daemon method object in the last Run method invocation. %outputObj must be deep copyable, as described in Copying objects.

Usage notes

  • ReturnObject and ReturnInfoObject can only be issued on daemon threads.
  • You can invoke ReturnObject and/or ReturnInfoObject as many times as you want for a single Run call. Each subsequent invocation replaces the object from the previous invocation of the same method.
  • You can invoke ReturnObject even if Run has no output parameter, and you can invoke ReturnInfoObject even if Run has no Info parameter.
  • A class mismatch between the ReturnObject argument and the Run output argument; or between the ReturnInfoObject argument and the Run Info argument, causes request cancellation in the master thread at the time the daemon finishes and Run method was about to return.
  • ReturnInfoObject was added in "Sirius Mods" Version 6.8.

See also