HaveDaemon (Daemon property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (match syntax table to syntax template, tags and edits)
Line 1: Line 1:
{{Template:Daemon:HaveDaemon subtitle}}
{{Template:Daemon:HaveDaemon subtitle}}
 
<var>HaveDaemon</var> returns a <var>[[Boolean enumeration]]</var> that indicates whether the daemon thread associated with the <var>[[Daemon class|Daemon]]</var> method object is accessible.
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==
==Syntax==
Line 10: Line 6:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%bool</th>
<tr><th>%boolean</th>
<td>A declared enumeration object of type Boolean to contain the returned value of HaveDaemon. </td></tr>
<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>
<tr><th>%daem</th>
<tr><th>daemon</th>
<td>A previously defined and instantiated Daemon object.</td></tr>
<td>A previously defined and instantiated <var>[[Daemon class|Daemon]]</var> object.</td></tr>
</table>
</table>
   
   
HaveDaemon returns <tt>True</tt> unless the daemon thread logged off, for whatever reason.
==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.
==Example==
<p class="code">begin
  %speed is object daemon global
In the following example, a global daemon updates an XML document, then HaveDaemon verifies the continued existence of the daemon.
  %list is object stringList
 
  %tiny is object xmlDoc
<p class="code">b
  %bool is enumeration boolean
%speed is object daemon global
  %speed = new
%list is object stringList
  %speed:run('*LOWER')
%tiny is object xmlDoc
 
%bool is enumeration boolean
  %list = new
%speed = new
  text to %list
%speed:run('*LOWER')
      begin
 
        %doc is object xmlDoc
%list = new
        %(daemon):getInputObject(%doc)
text to %list
        %doc:selectSingleNode('/out/in'):addAttribute('foo','bar')
b
        %(daemon):returnObject(%doc)
%doc is object xmlDoc
      end
%(daemon):getInputObject(%doc)
  end text
%doc:selectSingleNode('/out/in'):addAttribute('foo','bar')
%(daemon):returnObject(%doc)
end
end text


%tiny = new
  %tiny = new
%tiny:loadXml('<out><in></in></out>')
  %tiny:loadXml('<out><in></in></out>')
%speed:run(%list, %tiny, %tiny)
  %speed:run(%list, %tiny, %tiny)
%tiny:print
  %tiny:print


%bool = %speed:havedaemon
  %bool = %speed:havedaemon
Print '%bool is ' %bool:tostring
  print '%bool is ' %bool:tostring
end
end
</p>
</p>
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>
</p></ol>
 


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

Revision as of 01:13, 14 March 2011

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.

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

daemon A previously defined and instantiated Daemon object.

Examples

  1. 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