HaveDaemon (Daemon property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 9: Line 9:
{{Template:Daemon:HaveDaemon syntax}}
{{Template:Daemon:HaveDaemon syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<tr><th>%bool</th>
<dt>%bool  
<td>A declared enumeration object of type Boolean to contain the returned value of HaveDaemon. </td></tr>
<dd>A declared enumeration object of type Boolean to contain the returned value of HaveDaemon.  
<tr><th>%daem</th>
<dt>%daem  
<td>A previously defined and instantiated Daemon object.</td></tr>
<dd>A previously defined and instantiated Daemon object.  
</table>
</dl>
   
   
HaveDaemon returns <tt>True</tt> unless the daemon thread logged off, for whatever reason.
HaveDaemon returns <tt>True</tt> unless the daemon thread logged off, for whatever reason.

Revision as of 04:53, 7 February 2011

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


HaveDaemon is a member of the Daemon class

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


Syntax

%boolean = daemon:HaveDaemon

Syntax terms

%bool A declared enumeration object of type Boolean to contain the returned value of HaveDaemon.
%daem A previously defined and instantiated Daemon object.

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

Example

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

b
%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
b
%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