.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>ploticus: select attributes</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>select attributes</h2></td>
  <td align=right>
  <small>
  <a href="../doc/welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  Version 2.40 Jan'08
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH select_attributes PL "15-JAN-2008   PL ploticus.sourceforge.net"

.SH select attributes
These are used to select certain records from the
.ig >>
<a href="dataformat.html#currentds">
.>>
\0current data set.
.ig >>
</a>
.>>
Many of the ploticus procs support a \fCselect\fR attribute.

.ig >>
<br><br><br>
.>>
.SH Examples

.LP
\fCselect:  @@2 = A\fR
.ig >>
&nbsp; &nbsp;
.>>
.ig >>
&nbsp; &nbsp;
.>>
(select all records where 2nd field is A)

.LP
\fCselect:  @@2 < 100\fR
.ig >>
&nbsp; &nbsp;
.>>
.ig >>
&nbsp; &nbsp;
.>>
(select all records where 2nd field less than 100)

.LP
\fCselect:  @@group in C,D\fR
.ig >>
&nbsp; &nbsp;
.>>
.ig >>
&nbsp; &nbsp;
.>>
(select all records where the \fCgroup\fR field is \fCC\fR or \fCD\fR.
this assumes that data fields have been given names)

.LP
\fCselect:  @@group in C,D && @@sex = f\fR
.ig >>
&nbsp; &nbsp;
.>>
.ig >>
&nbsp; &nbsp;
.>>
(select all records where the \fCgroup\fR field is \fCC\fR or \fCD\fR and
the \fCsex\fR field is \fCf\fR.

.ig >>
<br><br><br>
.>>
.SH Notes
As seen in the above examples, two at-signs (\fC@@\fR) must be used when the \fCselect\fR
statement resides within a ploticus script and will be subjected to the script interpreter.
Character constants should not be enclosed in quotes.
Parentheses may not be used to establish precedence.


.ig >>
<br><br><br>
.>>
.SH Operands
Operands may be 
.IP \(bu
field numbers, e.g. \fC@@1\fR is the first data field
.IP \(bu
field names, e.g. \fC@@group\fR (field names must be in effect)
.IP \(bu
Literal values  (numerics, unquoted strings, 
.ig >>
<a href="commalist.html">
.>>
\0comma-delimited lists
.ig >>
</a>
.>>
) 
.IP \(bu
Ploticus @variables or variables that you set
(use one at-sign)
.IP \(bu
.ig >>
<a href="functions.html">
.>>
\0functions
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>

.SH Comparison operators
.IP
.nf
\fB= \fR	Equal to.  This is case sensitive for strings. 
\fB!=\fR	Not equal to. 
\fB> \fR	Greater than.
\fB>=\fR 	Greater than or equal to. 
\fB< \fR 	Less than. 
\fB<=\fR 	Less than or equal to. 
.fi
.LP
Data types: if both sides of a comparison are numeric, a numeric comparison will be done.
Otherwise, a string comparison will be done.
.LP
\fBWild card matching\fR:  Wild card matching may be done
using \fBlike\fP.  Wild card characters are \fB*\fR which matches
any number of any character, and \fB?\fR which matches a single
instance of any character.  This matching is case-insensitive.
.IP
.nf
\fBlike\fR	Wild card match.  Example: \fChello like h*\fR (true)
\fB!like\fR	Not a wild card match.
.LP
\fBCommalist operators\fP: these take a
.ig >>
<a href="commalist.html">
.>>
\0commalist
.ig >>
</a>
.>>
on the right side.
.IP
.nf
\fBin\fR	Member of list.  Example: \fCz in x,y,z\fR (true)
\fB!in\fR	Not a member of list. (Alt: \fBni\fR)
\fBinlike\fR 	Same as \fBin\fP but wild card matching is used.
		(Wild cards may be used in list members.)
\fB!inlike\fR	Same as \fB!in\fP but wild card matching is used.
.fi

.ig >>
<br><br><br>
.>>

.SH Logical connectors
Individual conditional expressions may be connected together using
logical AND (\fB&&\fR) or OR (\fB||\fR).
An entire expression may be negated by putting \fBnot:\fR at the beginning
of the expression.
.LP
Because parentheses may not be used to establish precedence
mixing AND and OR in the same expression requires care.
When the expression is parsed, it is first
split into OR terms, then each of the OR terms is split into AND terms.
For example: \fCA = B and C = D or E = E of F = G\fR would evaluate to true,
because it is interpreted as if it were written 
\fC(a = B and C = D) or (e = e) or (f = g)\fR.
It may be best to avoid mixing AND and OR in the same expression 
and use multiple expressions instead.

.ig >>
<br><br><br>
.>>

.SH Limitations and bugs
.LP
Because parentheses may not be used to establish precedence,
the mixing of AND and OR in the same expression is problematic (see above).


.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif"> 
</center>
</td></tr>
</table>
<br>
<center>
Ploticus is hosted at http://ploticus.sourceforge.net <br>
<img src="http://sourceforge.net/sflogo.php?group_id=38453" width="88" height="31" border="0" alt="SourceForge Logo">
</center>
.>>

