HaveDaemon (Daemon property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (match syntax table to syntax template, tags and edits)
 
(3 intermediate revisions by one other user not shown)
Line 7: Line 7:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%boolean</th>
<tr><th>%boolean</th>
<td>A <var>[[Boolean enumeration]]</var> to contain the returned value of <var>HaveDaemon</var>.<p><var>HaveDaemon</var>returns <code>True</code> unless the daemon thread logged off, for whatever reason.</p> </td></tr>
<td>A <var>Boolean</var> enumeration to contain the returned value of <var>HaveDaemon</var>.
<p><var>HaveDaemon</var> returns <code>True</code> unless the daemon thread logged off, for whatever reason.</p> </td></tr>
<tr><th>daemon</th>
<tr><th>daemon</th>
<td>A previously defined and instantiated <var>[[Daemon class|Daemon]]</var> object.</td></tr>
<td>A <var>Daemon</var> object.</td></tr>
</table>
</table>
 
==Examples==
==Examples==
<ol><li>In the following example, a global daemon updates an XML document, then <var>HaveDaemon</var> verifies the continued existence of the daemon.
In the following example, a global daemon updates an XML document, then <var>HaveDaemon</var> verifies the continued existence of the daemon.
<p class="code">begin
<p class="code">begin
   %speed is object daemon global
   %speed is object daemon global
Line 43: Line 44:
The example above returns this result:
The example above returns this result:
<p class="code"><out><in foo="bar"/></out>%bool is True
<p class="code"><out><in foo="bar"/></out>%bool is True
</p></ol>
</p>


==See also==
==See also==
{{Template:Daemon:HaveDaemon footer}}
{{Template:Daemon:HaveDaemon footer}}

Latest revision as of 02:14, 8 July 2012

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