<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>Operators</title><revhistory><revision><revnumber>15</revnumber><date>2018-01-02 11:35:32</date><authorinitials>LKD70</authorinitials></revision><revision><revnumber>14</revnumber><date>2015-08-10 00:56:50</date><authorinitials>LKD70</authorinitials></revision><revision><revnumber>13</revnumber><date>2015-08-10 00:50:31</date><authorinitials>LKD70</authorinitials></revision><revision><revnumber>12</revnumber><date>2015-08-10 00:50:17</date><authorinitials>LKD70</authorinitials></revision><revision><revnumber>11</revnumber><date>2015-08-09 21:13:19</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>10</revnumber><date>2015-08-09 21:09:10</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>9</revnumber><date>2015-08-09 21:08:49</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>8</revnumber><date>2014-02-10 19:15:19</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>7</revnumber><date>2014-02-10 17:59:49</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>6</revnumber><date>2013-12-08 20:40:12</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>5</revnumber><date>2012-12-04 18:33:12</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>4</revnumber><date>2012-10-28 21:59:40</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>3</revnumber><date>2012-10-28 21:56:55</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>2</revnumber><date>2012-10-28 21:49:25</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>1</revnumber><date>2012-10-28 21:23:17</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><para>The following symbols are characters that specify how to combine, compare, or modify the values of an expression. These will be used in performing math operations, setting variables, and comparing operators or variables in conditional statements (ifgoto, ifgosub). </para><para><emphasis role="strong">Arithmetic</emphasis> </para><informaltable><tgroup cols="5"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Symbol </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Name</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry><entry align="center" colsep="1" nameend="col_4" namest="col_3" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>+ </para></entry><entry colsep="1" rowsep="1"><para>addition </para></entry><entry colsep="1" rowsep="1"><para>Adds numeric expressions. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>-- </para></entry><entry colsep="1" rowsep="1"><para>decrement </para></entry><entry colsep="1" rowsep="1"><para>Subtracts 1 from the operand. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>++ </para></entry><entry colsep="1" rowsep="1"><para>increment </para></entry><entry colsep="1" rowsep="1"><para>Adds 1 to the operand. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>/ </para></entry><entry colsep="1" rowsep="1"><para>division </para></entry><entry colsep="1" rowsep="1"><para>Divides expression1 by expression2. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>++ </para></entry><entry colsep="1" rowsep="1"><para>increment </para></entry><entry colsep="1" rowsep="1"><para>Adds 1 to an expression. ** Not implemented yet </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>MOD </para></entry><entry colsep="1" rowsep="1"><para>modulo </para></entry><entry colsep="1" rowsep="1"><para>Calculates the remainder of expression1 divided by expression2. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>* </para></entry><entry colsep="1" rowsep="1"><para>multiplication </para></entry><entry colsep="1" rowsep="1"><para>Multiplies two numerical expressions. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>- </para></entry><entry colsep="1" rowsep="1"><para>subtraction </para></entry><entry colsep="1" rowsep="1"><para>Used for negating or subtracting. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para> &lt;&lt; </para></entry><entry colsep="1" rowsep="1"><para>left shift </para></entry><entry colsep="1" rowsep="1"><para>Shifts the first operand by the given number of bits to the left. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para> &gt;&gt; </para></entry><entry colsep="1" rowsep="1"><para>right shift </para></entry><entry colsep="1" rowsep="1"><para>Shifts the first operand by the given number of bits to the right. </para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">Comparison</emphasis> </para><informaltable><tgroup cols="5"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Symbol </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Name</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry><entry align="center" colsep="1" nameend="col_4" namest="col_3" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&amp;&amp; </para></entry><entry colsep="1" rowsep="1"><para>and </para></entry><entry colsep="1" rowsep="1"><para>Checks to see if both/all expressions are true. (alternatively: and) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para><code>||</code> </para></entry><entry colsep="1" rowsep="1"><para>or </para></entry><entry colsep="1" rowsep="1"><para>Checks to see if either/any expressions are true.(alternatively: or) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>== </para></entry><entry colsep="1" rowsep="1"><para>equality </para></entry><entry colsep="1" rowsep="1"><para>Tests two expressions for equality. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&gt; </para></entry><entry colsep="1" rowsep="1"><para>greater than </para></entry><entry colsep="1" rowsep="1"><para>Compares two expressions and determines whether expression1 is greater than expression2; if it is, the result is true. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&gt;= </para></entry><entry colsep="1" rowsep="1"><para>greater than or equal to </para></entry><entry colsep="1" rowsep="1"><para>Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false). </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>!= </para></entry><entry colsep="1" rowsep="1"><para>inequality </para></entry><entry colsep="1" rowsep="1"><para>Tests for the exact opposite of the equality (==) operator. (Alternatively: &lt;&gt;)</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&lt; </para></entry><entry colsep="1" rowsep="1"><para>less than </para></entry><entry colsep="1" rowsep="1"><para>Compares two expressions and determines whether expression1 is less than expression2; if so, the result is true. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&lt;= </para></entry><entry colsep="1" rowsep="1"><para>less than or equal to </para></entry><entry colsep="1" rowsep="1"><para>Compares two expressions and determines whether expression1 is less than or equal to expression2; if it is, the result is true. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>is </para></entry><entry colsep="1" rowsep="1"><para>is </para></entry><entry colsep="1" rowsep="1"><para>Evaluates whether an object is compatible with a specific data type. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>in </para></entry><entry colsep="1" rowsep="1"><para>in </para></entry><entry colsep="1" rowsep="1"><para>Evaluates whether the given property is part of a specific object. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>| </para></entry><entry colsep="1" rowsep="1"><para>bitwise OR </para></entry><entry colsep="1" rowsep="1"><para>Returns a 1 in each bit position for which the corresponding bits of either or both operands are 1's. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>^ </para></entry><entry colsep="1" rowsep="1"><para>bitwise XOR </para></entry><entry colsep="1" rowsep="1"><para>Returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1's.</para></entry></row></tbody></tgroup></informaltable><para>||&amp; ||bitwise AND ||Returns a 1 in each bit position for which the corresponding bits of both operands are 1's. </para><para><emphasis role="strong">Assignment</emphasis> </para><informaltable><tgroup cols="5"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Symbol </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Name</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry><entry align="center" colsep="1" nameend="col_4" namest="col_3" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>= </para></entry><entry colsep="1" rowsep="1"><para>assignment </para></entry><entry colsep="1" rowsep="1"><para>Assigns the value of expression2 (the operand on the right) to the variable, array element, or property in expression1. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>+= </para></entry><entry colsep="1" rowsep="1"><para>Addition assignment </para></entry><entry colsep="1" rowsep="1"><para>Adds the value of right operand (expression2) to expression1 and assigns the result. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>-= </para></entry><entry colsep="1" rowsep="1"><para>Subtraction assignment </para></entry><entry colsep="1" rowsep="1"><para>Subtracts the value of right operand (expression2) from expression1 and assigns the result. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>*= </para></entry><entry colsep="1" rowsep="1"><para>Multiplication assignment </para></entry><entry colsep="1" rowsep="1"><para>Multiplies the value of the two expressions and assigns the result. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>/= </para></entry><entry colsep="1" rowsep="1"><para>Division assignment </para></entry><entry colsep="1" rowsep="1"><para>Divides the value of the first expression by that of the second and assigns the result. </para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">String</emphasis> </para><informaltable><tgroup cols="5"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Symbol </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Name</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry><entry align="center" colsep="1" nameend="col_4" namest="col_3" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>+ </para></entry><entry colsep="1" rowsep="1"><para>concatenation </para></entry><entry colsep="1" rowsep="1"><para>Concatenates (combines) strings. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>&quot; </para></entry><entry colsep="1" rowsep="1"><para>string delimiter </para></entry><entry colsep="1" rowsep="1"><para>When used before and after characters, indicates that the characters have a literal value and are considered a string, not a variable, numerical value, or other element. </para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">Other</emphasis> </para><informaltable><tgroup cols="5"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><colspec colname="col_4"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Symbol </emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Name</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description </emphasis> </para></entry><entry align="center" colsep="1" nameend="col_4" namest="col_3" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>@ </para></entry><entry colsep="1" rowsep="1"><para>Silent mode </para></entry><entry colsep="1" rowsep="1"><para>When used at the start of a line it suppresses all log-based output from that single line. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>! </para></entry><entry colsep="1" rowsep="1"><para>Negation/NOT </para></entry><entry colsep="1" rowsep="1"><para> Negates the following expression. </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>? </para></entry><entry colsep="1" rowsep="1"><para>Conditional/ternary </para></entry><entry colsep="1" rowsep="1"><para> if the given condition is true, the first value is given, otherwise the second is given. </para></entry></row></tbody></tgroup></informaltable><para><emphasis role="strong">Examples:</emphasis> </para><para><emphasis role="strong">Arithmetic</emphasis> </para><screen><![CDATA[// Math!
myVar=2
echo 10 * myVar
]]><![CDATA[
Result:
17:49:02 20
17:49:03 Script stopped]]></screen><para><emphasis role="strong">Comparison</emphasis> </para><screen><![CDATA[// Testing two numbers using comparison
ifgoto (1 != 2) doesnot
echo "They are equal!"
end
]]><![CDATA[
label doesnot
echo "They are not equal!"
end
]]><![CDATA[
Result:
17:25:54 They are not equal!
17:25:55 Script stopped]]></screen><para><emphasis role="strong">Assignment</emphasis> </para><screen><![CDATA[//Setting a variable called myVar and giving it a value of 1.
myVar=1
echo "My variable is " + myVar
]]><![CDATA[
Result:
17:47:31 My variable is 1
17:47:32 Script stopped]]></screen><para><emphasis role="strong">String</emphasis> </para><screen><![CDATA[//Combine two strings together to form a greeting
myVar="Hello"
myVar2=" there!"
echo myVar + myVar2
]]><![CDATA[
Result:
17:56:38 Hello there!
17:56:39 Script stopped]]></screen><screen><![CDATA[// let us know if the variable is true using a conditional operator.
var = true
echo "var " + (var == true ? "is" : "is not") + " true"
]]><![CDATA[
Result:
11:17:03 var is true
11:17:04 Script stopped]]></screen><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/Operators/wiki/CategoryConstants#">CategoryConstants</ulink> </para></article>