.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>quisp: lists</title>
<body bgcolor=99cc99 vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td align=right><a href="quisp_home.html">
<img src="img/quisp2.gif" border=0><br><small>quick server pages</a> &nbsp; &nbsp; </td></tr>
<td>
.>>

.TH lists TDH "31-MAR-2004   TDH scg@jax.org" 

.SH Comma-delimited lists
A comma-delimited list (or "list" for short) is a list of items, delimited with commas
like this: \fCHarry,Ron,Hermione\fR
.LP
Lists are useful in storing sets or groups.  They can serve some of the same purposes
that arrays serve in other languages.  In databases, lists can conveniently provide a degree of
vectorization without requiring a separate table and joins.  
Lists can be a powerful approach-- the infamous programming language LISP made great use of lists.
.LP
There are a number of 
.ig >>
<a href="functions.html#commalists">
.>>
\0functions for working with lists.
.ig >>
</a>
.>>
.LP
Lists can be used...
.IP \(bu
as sets of items.. members can be added or removed from lists.
.IP \(bu
to control iteration (#for loops)

.LP
In QUISP/SHSQL, lists can be used...
.IP \(bu
with \fC<select multiple>\fR CGI form fields.  The
.ig >>
<a href="optionlist.html">
.>>
\0#optionlist
.ig >>
</a>
.>>
directive allows
<select multiple> boxes to be initialized directly by a list.
When a form is submitted <select multiple> responses can be converted to a list in the 
.ig >>
<a href="cgiforms.html">
.>>
\0form target page
.ig >>
</a>
.>>
using the
.ig >>
<a href="cgivar.html">
.>>
\0#cgilistvar
.ig >>
</a>
.>>
directive.
.IP \(bu
in WHERE clauses along with the IN, INLIKE, and INRANGE comparison operators;
SHSQL provides full index support for IN, INLIKE, and INRANGE
.IP \(bu
in databases to provide a limited degree of vectorization, a list of keywords associated with publications for instance.
As long as a JOIN on the list field is never required, this approach can simplify front-end code.
SHSQL allows such list fields to be indexed using a WORD index, and retrieved using CONTAINS in the
WHERE clause, for full index support.  

.LP
Since the total length of a comma-delimited list is limited to about 250 characters,
lists are most suitable where individual values are known to be small in size 
(such as controlled-vocabulary tags or integer id numbers) and where it is known that 
there will not be a huge number of choices. 
List members can not contain embedded commas, and there is no provision for escaping a comma.
List members can contain embedded spaces in most situations.



.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="quisp_home.html">
<img src="img/quisp2.gif" border=0></a><br>
<small>quick server pages &nbsp; &nbsp;<br>
<a href="Copyright.html">Copyright Steve Grubb</a> &nbsp; &nbsp;
</td></tr>
</table>
.>>
