HaveDaemon (Daemon property)

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Is the thread associated with this Daemon accessible? (Daemon class)

HaveDaemon returns a Boolean enumeration that indicates whether the daemon thread associated with the Daemon method object is accessible.

Syntax

%boolean = daemon:HaveDaemon

Syntax terms

%boolean A Boolean enumeration to contain the returned value of HaveDaemon.

HaveDaemon returns True unless the daemon thread logged off, for whatever reason.

daemon A Daemon object.

Examples

In the following example, a global daemon updates an XML document, then HaveDaemon verifies the continued existence of the daemon.

begin %speed is object daemon global %list is object stringList %tiny is object xmlDoc %bool is enumeration boolean %speed = new %speed:run('*LOWER') %list = new text to %list begin %doc is object xmlDoc  %(daemon):getInputObject(%doc) %doc:selectSingleNode('/out/in'):addAttribute('foo','bar')  %(daemon):returnObject(%doc) end end text %tiny = new %tiny:loadXml('<out><in></in></out>') %speed:run(%list, %tiny, %tiny) %tiny:print %bool = %speed:havedaemon print '%bool is ' %bool:tostring end

The example above returns this result:

<out><in foo="bar"/></out>%bool is True

See also