<html> <head> <!-- This file has been generated by unroff 1.0, 03/11/09 12:56:22. --> <!-- Do not edit! --> <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.41 Mar2009 <td></tr></table> </td></tr> <td> <br> <br> <title>Manual page for select_attributes(PL)</title> </head> <body> <h2>select attributes</h2> These are used to select certain records from the <a href="dataformat.html#currentds"> current data set.<tt> </tt> </a> Many of the ploticus procs support a <tt>select</tt> attribute.<tt> </tt> <br><br><br> <h2>Examples</h2> <p> <tt>select: @@2 = A</tt> (select all records where 2nd field is A) <p> <tt>select: @@2 < 100</tt> (select all records where 2nd field less than 100) <p> <tt>select: @@group in C,D</tt> (select all records where the <tt>group</tt> field is <tt>C</tt> or <tt>D</tt>.<tt> </tt> this assumes that data fields have been given names) <p> <tt>select: @@group in C,D && @@sex = f</tt> (select all records where the <tt>group</tt> field is <tt>C</tt> or <tt>D</tt> and the <tt>sex</tt> field is <tt>f</tt>.<tt> </tt> <br><br><br> <h2>Notes</h2> As seen in the above examples, two at-signs (<tt>@@</tt>) must be used when the <tt>select</tt> statement resides within a ploticus script and will be subjected to the script interpreter.<tt> </tt> Character constants should not be enclosed in quotes.<tt> </tt> Parentheses may not be used to establish precedence.<tt> </tt> <br><br><br> <h2>Operands</h2> Operands may be <ul> <li> field numbers, e.g. <tt>@@1</tt> is the first data field <li> field names, e.g. <tt>@@group</tt> (field names must be in effect) <li> Literal values (numerics, unquoted strings, <a href="commalist.html"> comma-delimited lists </a> ) <li> Ploticus @variables or variables that you set (use one at-sign) <li> <a href="functions.html"> functions </a> <br><br><br> </ul> <h2>Comparison operators</h2> <dl> <dt><dd><p> <pre> <b>= </b> Equal to. This is case sensitive for strings. <b>!=</b> Not equal to. <b>> </b> Greater than. <b>>=</b> Greater than or equal to. <b>< </b> Less than. <b><=</b> Less than or equal to. </pre> </dl> <p> Data types: if both sides of a comparison are numeric, a numeric comparison will be done.<tt> </tt> Otherwise, a string comparison will be done.<tt> </tt> <p> <b>Wild card matching</b>: Wild card matching may be done using <b>like</b>. Wild card characters are <b>*</b> which matches any number of any character, and <b>?</b> which matches a single instance of any character. This matching is case-insensitive.<tt> </tt> <dl> <dt><dd><p> <pre> <b>like</b> Wild card match. Example: hello like h* (true) <b>!like</b> Not a wild card match. </pre> </dl> <p> <b>Commalist operators</b>: these take a <a href="commalist.html"> commalist </a> on the right side.<tt> </tt> <dl> <dt><dd><p> <pre> <b>in</b> Member of list. Example: z in x,y,z (true) <b>!in</b> Not a member of list. (Alt: <b>ni</b>) <b>inlike</b> Same as <b>in</b> but wild card matching is used. (Wild cards may be used in list members.) <b>!inlike</b> Same as <b>!in</b> but wild card matching is used. </pre> <br><br><br> </dl> <h2>Logical connectors</h2> Individual conditional expressions may be connected together using logical AND (<b>&&</b>) or OR (<b>||</b>).<tt> </tt> An entire expression may be negated by putting <b>not:</b> at the beginning of the expression.<tt> </tt> <p> Because parentheses may not be used to establish precedence mixing AND and OR in the same expression requires care.<tt> </tt> When the expression is parsed, it is first split into OR terms, then each of the OR terms is split into AND terms.<tt> </tt> For example: <tt>A = B and C = D or E = E of F = G</tt> would evaluate to true, because it is interpreted as if it were written <tt>(a = B and C = D) or (e = e) or (f = g)</tt>.<tt> </tt> It may be best to avoid mixing AND and OR in the same expression and use multiple expressions instead.<tt> </tt> <br><br><br> <h2>Limitations and bugs</h2> <p> Because parentheses may not be used to establish precedence, the mixing of AND and OR in the same expression is problematic (see above).<tt> </tt> <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 <br> <a href="../doc/Copyright.html">Copyright Steve Grubb</a> <br> <br> <center> <img src="../gallery/all.gif"> </center> </td></tr> </table> <br> <center> <table><tr><td> Ploticus is hosted at http://ploticus.sourceforge.net</td><td> </td><td> <a href="http://sourceforge.net/projects/ploticus"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=38453&type=12" width="120" height="30" border="0" alt="Get ploticus data display engine at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> </td></tr></table> </center> <p><hr> Markup created by <em>unroff</em> 1.0, <tt> </tt> <tt> </tt>March 11, 2009. </body> </html>