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

<body>

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

<hr>

<p>
<font size=+1><i>LIST</i> <b>sublist</b>(<i>LIST <b>list</b>, INTEGER <b>start</b>[, INTEGER <b>length</b>]</i>)</font>

<p>This function returns a subrange of the list specified by <VAR>list</VAR>.
The subrange starts at position <var>start</var>, and continues <var>length</var> elements.  If <var>length</var> is unspecified, it will continue to the
end of the list.  If <var>start</var> is outside of the range of the
list, or <var>length</var> will extend past the end of the list, the error
<code>~range</code> is thrown.

<P>Examples:
<blockquote>
<PRE>
sublist([2, 3, 4, 5, 6, 7], 2, 3)
=&gt; [3, 4, 5]

sublist([2, 3, 4, 5, 6, 7], 3)
=&gt; [4, 5, 6, 7]

sublist([2, 3, 4, 5, 6, 7], 7)
=&gt; []
</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>