<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head xmlns="http://www.w3.org/1999/xhtml"><title xmlns="http://www.w3.org/1999/xhtml">Operators</title><meta xmlns="http://www.w3.org/1999/xhtml" name="generator" content="DocBook XSL Stylesheets V1.50.0"/><link rel="home" href="index.html" title="Pilot-DB Users Manual"/><link rel="up" href="ch09.html" title="Chapter 9. Scripts"/><link rel="previous" href="ch09s02.html" title="Arguments"/><link rel="next" href="ch09s04.html" title="Inter-Records scripts"/></head><body><div xmlns="http://www.w3.org/1999/xhtml" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Operators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch09s02.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Scripts</th><td width="20%" align="right"> <a accesskey="n" href="ch09s04.html">Next</a></td></tr></table><hr/></div><div xmlns="http://www.w3.org/1999/xhtml" class="section"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h2 class="title" style="clear: both"><a xmlns="http://www.w3.org/1999/xhtml" id="id2831471"/>Operators</h2></div></div><fake><p xmlns="http://www.w3.org/1999/xhtml">
     Each clause begins with an operator that is recognized by the script
     engine. Current possibilities are listed below:
    </p></fake><div xmlns="http://www.w3.org/1999/xhtml" class="informaltable"><table xmlns="http://www.w3.org/1999/xhtml" border="1"><colgroup xmlns="http://www.w3.org/1999/xhtml"><col xmlns="http://www.w3.org/1999/xhtml"/><col xmlns="http://www.w3.org/1999/xhtml"/><col xmlns="http://www.w3.org/1999/xhtml"/></colgroup><thead><tr xmlns="http://www.w3.org/1999/xhtml"><th align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Operator &amp; Args</p></fake></th><th align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Purpose</p></fake></th><th align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Explanation</p></fake></th></tr></thead><tbody xmlns="http://www.w3.org/1999/xhtml"><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">+ [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Add</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 or more arguments, each of which
                                        must be a number</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">- [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Subtract</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 or more arguments, each of which
                                        must be a number</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">* [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Multiply</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 or more arguments, each of which
                                        must be a number</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">/ [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Divide</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 or more arguments, each of which
                                        must be a number</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">eq [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Equality</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a number. Returns true if they
                                        are numerically equivalent.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">lt [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Less-Than</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a number. Returns true if
                                        [a] is less than [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">gt [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Greater-Than</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a number. Returns true if 
                                        [a] is greater than [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">le [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Less-Equal</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a number. Returns true if
                                        [a] is less than or equal to [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">ge [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Greater-Equal</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a number. Returns true if 
                                        [a] is greater than or equal to [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">! [arg]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Not</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 argument. Returns true if
                                        [arg] is false.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">seq [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">String-Equal</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a string. Returns true if
                                        [a] is  equal to [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">sstr [a] [b]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Is-SubString</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 arguments, each of which must
                                        be a string. Returns true if and only if 
                                        [a] contains the string [b].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">? [test] [t] [f]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Conditional</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">3 arguments.
                                        If the first, [test], is true 
                                        (non-zero) returns the result
                                        contained in [t].
                                        Otherwise, returns the result in [f].</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">br [b] [res-0] ...[res-n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Branch</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">2 or more arguments.
                                        The first, [b], must be an integer,
                                        the remaining elements are treated as
                                        a list indexed from 0 to n.
                                        If [b] &lt;= 0, returns the result
                                        contained in [res-0].
                                        If [b] &gt;= n where n is the index
                                        of the last argument, returns [res-n].
                                        Otherwise, returns the [b]<sup xmlns="http://www.w3.org/1999/xhtml">th</sup> element
                                        in the list of results.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">all [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Do All</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 or more arguments.
                                        Evaluate each argument and return
                                        the result of the last one.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">or [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Logical Or</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 or more arguments.
                                        Returns 1 if one or more arguments
                                        evaluates to true.  Returns 0
                                        otherwise.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">and [a] ... [n]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Logical And</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 or more arguments.
                                        Returns 1 if all arguments
                                        evaluate to true.  Returns 0
                                        otherwise.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">rand</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Random Number</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">0 arguments.  This function generates
                                        a random integer greater than zero.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">int [a]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">TCast to Int</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 argument.  Casts the argument as
                                        an integer value.  Limited support,
                                        but it works for dates and times.</p></fake></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">dur [a]</td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">Cast to Dur</p></fake></td><td align="left"><fake><p xmlns="http://www.w3.org/1999/xhtml">1 argument.  Casts the argument as
                                        a duration.  Currently, this
                                        only works for integer type fields.
                                        The integer value will be interpreted
                                        as the number of minutes since midnight
                                        January 1, 1904, and displayed as
                                        the number of days, hours and minutes
                                        since then.</p></fake></td></tr></tbody></table></div><fake><p xmlns="http://www.w3.org/1999/xhtml">
     Example:
    </p></fake><fake><p xmlns="http://www.w3.org/1999/xhtml">
     Here are some uses:
    </p></fake><pre xmlns="http://www.w3.org/1999/xhtml" class="screen">(+ %0 %1)</pre><fake><p xmlns="http://www.w3.org/1999/xhtml">
     add fields 0 and 1 together
    </p></fake><pre xmlns="http://www.w3.org/1999/xhtml" class="screen">(+ %0 (* %1 4))</pre><fake><p xmlns="http://www.w3.org/1999/xhtml">
     add field 0 to  4*(field 1)
    </p></fake><pre xmlns="http://www.w3.org/1999/xhtml" class="screen">(? (eq %0 10) 100 -100)</pre><fake><p xmlns="http://www.w3.org/1999/xhtml">
     if field 0 equals 10, return 100, else return -100
    </p></fake><pre xmlns="http://www.w3.org/1999/xhtml" class="screen">(all 5)</pre><fake><p xmlns="http://www.w3.org/1999/xhtml">
     just return the constant 5
    </p></fake></div><div xmlns="http://www.w3.org/1999/xhtml" class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch09s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch09.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch09s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Arguments </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Inter-Records scripts</td></tr></table></div></body></html>
