/
ColdC/Functions/
ColdC/Structure/
<head><title>ColdC: Function/Method Reference: insert()</title></head>

<body>

<h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: insert()</h1>

<hr>

<p>
<font size=+1><i>LIST</i> <b>insert</b>(<i>LIST <b>list</b>, INTEGER <b>pos</b>, ANY <b>value</b></i>)</font>

<p>This function inserts <VAR>value</VAR> into <VAR>list</VAR> before the
element specified by the integer <VAR>pos</VAR>.  If <VAR>pos</VAR> is less
than one or is more than one more than the length of <VAR>list</VAR>, then
the error <code>~range</code> is thrown.

<P>Examples:

<blockquote>
<PRE>
insert([2, 3, 4], 3, 'foo) 
=&gt; [2, 3, 'foo, 4] 

insert(["foo", 'bar, ~none], 4, 'baz)
=&gt; ["foo", 'bar, ~none, 'baz]
</PRE>
</blockquote>

<p><hr size=4><p align=center><i>Last Modified on 24 Mar 1996</i>
<br><i>Copyright &copy; 1995, 1996, Brandon Gillespie</i>
</body>