<?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=Linklist.insertbefore</id>
		<title>Linklist.insertbefore - 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=Linklist.insertbefore"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Linklist.insertbefore&amp;action=history"/>
		<updated>2026-05-01T03:28:51Z</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=Linklist.insertbefore&amp;diff=1125&amp;oldid=prev</id>
		<title>Ximan: Created page with &quot;== Calling Pattern == Call  local k = sl.linklist()  -- later  local n = k.insertbefore(a,b)  Arguments  a is a number  b is any value  Results  n is a number  == Example Usage =...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Linklist.insertbefore&amp;diff=1125&amp;oldid=prev"/>
				<updated>2010-12-18T21:52:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Calling Pattern == Call  local k = sl.linklist()  -- later  local n = k.insertbefore(a,b)  Arguments  a is a number  b is any value  Results  n is a number  == Example Usage =...&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 k = sl.linklist()&lt;br /&gt;
 -- later&lt;br /&gt;
 local n = k.insertbefore(a,b)&lt;br /&gt;
&lt;br /&gt;
Arguments&lt;br /&gt;
 a is a number&lt;br /&gt;
 b is any value&lt;br /&gt;
&lt;br /&gt;
Results&lt;br /&gt;
 n is a number&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
 local k = sl.linklist()&lt;br /&gt;
 local j = k.insertb(0,'one')&lt;br /&gt;
 local j0 = j&lt;br /&gt;
 j = k.insertb(j,'two')&lt;br /&gt;
 j = k.insertb(j,'three')&lt;br /&gt;
 print(k.getpos(j0))&lt;br /&gt;
 print(k.getpos(j))&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt; 3&lt;br /&gt;
     1 &lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
Calling insertbefore creates a new link with value b and inserts it before the link with psuedo-index a.  If the list is empty, a can be any number and the new link is also the head and tail of the list.  If the list is non-empty and a is not a valid pseudo-index, then insertbefore fails and returns 0.&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;
* [[deque]]&lt;br /&gt;
&lt;br /&gt;
* [[linklist]]&lt;br /&gt;
* [[linklist.head]]&lt;br /&gt;
* [[linklist.insertafter]]&lt;br /&gt;
* [[linklist.length]]&lt;br /&gt;
* [[linklist.nextlink]]&lt;br /&gt;
* [[linklist.prevlink]]&lt;br /&gt;
* [[linklist.removelink]]&lt;br /&gt;
* [[linklist.returntable]]&lt;br /&gt;
* [[linklist.setvalue]]&lt;br /&gt;
* [[linklist.swap]]&lt;br /&gt;
* [[linklist.tail]]&lt;br /&gt;
* [[linklist.value]]&lt;/div&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	</feed>