<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Machine.initiate</id>
		<title>Machine.initiate - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Machine.initiate"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Machine.initiate&amp;action=history"/>
		<updated>2026-05-01T04:13:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Machine.initiate&amp;diff=1193&amp;oldid=prev</id>
		<title>Ximan: /* Upon Error */</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Machine.initiate&amp;diff=1193&amp;oldid=prev"/>
				<updated>2011-01-04T01:13:46Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Upon Error&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 01:13, 4 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot; &gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Upon Error ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Errors occurring in any of the state functions are reported and handled according to the operant error redirection mode&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Requesting a non-existent state key during any transition is an error.&amp;#160; &lt;/ins&gt;Errors occurring in any of the state functions are reported and handled according to the operant error redirection mode&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== See Also ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== See Also ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Machine.initiate&amp;diff=1192&amp;oldid=prev</id>
		<title>Ximan: Created page with &quot;== Calling Pattern == Call  local m = sl.machine(a[,b])  -- later  local r = m.initiate([d[,...]]) Args  d1..dN optional are variadic arguments of any type Results  r0..rN are va...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Machine.initiate&amp;diff=1192&amp;oldid=prev"/>
				<updated>2011-01-04T01:09:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Calling Pattern == Call  local m = sl.machine(a[,b])  -- later  local r = m.initiate([d[,...]]) Args  d1..dN optional are variadic arguments of any type Results  r0..rN are va...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Calling Pattern ==&lt;br /&gt;
Call&lt;br /&gt;
 local m = sl.machine(a[,b])&lt;br /&gt;
 -- later&lt;br /&gt;
 local r = m.initiate([d[,...]])&lt;br /&gt;
Args&lt;br /&gt;
 d1..dN optional are variadic arguments of any type&lt;br /&gt;
Results&lt;br /&gt;
 r0..rN are values returned by the a.exit function&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 local s = {&lt;br /&gt;
  initiate = function(h,...) local a = {...} print('initiating '..a[1]) return 'a' end,&lt;br /&gt;
  a        = function(h) print('a')       return 'b'    end,&lt;br /&gt;
  b        = function(h) print('b')       return 'c'    end,&lt;br /&gt;
  c        = function(h) print('c')       return 'exit' end,&lt;br /&gt;
  exit     = function(h) print('exiting') return 999    end,&lt;br /&gt;
  monitor  = function(s,h,n,g) if g=='exit' then h[1]=h[1]+1; if h[1]&amp;lt;3 then g='a' end end; return g end,&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
 local h = {0}&lt;br /&gt;
 local m = sl.machine(s,h)&lt;br /&gt;
 local n = m.initiate('live')&lt;br /&gt;
 print(tostring(n))&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt; initiating live&lt;br /&gt;
     a&lt;br /&gt;
     b&lt;br /&gt;
     c&lt;br /&gt;
     a&lt;br /&gt;
     b&lt;br /&gt;
     c&lt;br /&gt;
     a&lt;br /&gt;
     b&lt;br /&gt;
     c&lt;br /&gt;
     exiting&lt;br /&gt;
     999&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
Calling initiate begins the execution of a previously defined state machine object by calling the function associated with the 'initiate' key in the state table.  If no errors are encountered during execution, initiate returns the results returned by the 'exit' state function.&lt;br /&gt;
&lt;br /&gt;
== Upon Error ==&lt;br /&gt;
&lt;br /&gt;
Errors occurring in any of the state functions are reported and handled according to the operant error redirection mode.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]&lt;br /&gt;
&lt;br /&gt;
* [[case]]&lt;br /&gt;
* [[chain]]&lt;br /&gt;
* [[iterator]]&lt;br /&gt;
* [[machine]]&lt;br /&gt;
* [[spin]]&lt;/div&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	</feed>