|
|
(18 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{HelpFiles}}
| |
− |
| |
| === Relational and Logical Operators === | | === Relational and Logical Operators === |
| | | |
| Relational refers to the relationships that values can have with one another, and logical refers to the ways in which true and false values can be connected together. Since the relational operators produce true or false results, they are often used in combination with the logical operators. | | Relational refers to the relationships that values can have with one another, and logical refers to the ways in which true and false values can be connected together. Since the relational operators produce true or false results, they are often used in combination with the logical operators. |
| | | |
− | The relational operators are as follows: | + | The relational operators are as follows:<br> |
− | | |
− | Not equal to
| |
| | | |
− | {| width="1189" cellspacing="0" cellpadding="2" border="1" class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" | + | {| width="1189" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | | | | width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | |
| '''Operator''' | | '''Operator''' |
Line 17: |
Line 13: |
| '''Meaning''' | | '''Meaning''' |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| == | | == |
| | | |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
− | Equal to
| + | equa to<br> |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | !=<br> | | | width="594" style="border:1px solid #010101;" | !=<br> |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| Not equal to | | Not equal to |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| > | | > |
Line 36: |
Line 32: |
| Greater than | | Greater than |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| < | | < |
Line 43: |
Line 39: |
| Less than | | Less than |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| >= | | >= |
Line 50: |
Line 46: |
| Greater than or equal to | | Greater than or equal to |
| | | |
− | |- align="left" valign="top" | + | |- valign="top" align="left" |
| | width="594" style="border:1px solid #010101;" | | | | width="594" style="border:1px solid #010101;" | |
| <= | | <= |
Line 61: |
Line 57: |
| Those relational operators cannot be applied to all data types and in some cases, two values of different types cannot be compared to each other. | | Those relational operators cannot be applied to all data types and in some cases, two values of different types cannot be compared to each other. |
| | | |
− | <table width="1189" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic">
| + | {| width="100%" border="1" cellpadding="1" cellspacing="1" align="left" |
− | <tbody><tr align="left" valign="top">
| + | |- |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | array |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">array</strong></p>
| + | | bool |
− | </td>
| + | | number |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">bool</strong></p>
| + | | question |
− | </td>
| + | | range |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">number</strong></p>
| + | | string |
− | </td>
| + | | datetime |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">question</strong></p>
| + | |- |
− | </td>
| + | | array |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">range</strong></p>
| + | | |
− | </td>
| + | | |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">string</strong></p>
| + | | |
− | </td>
| + | | |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">datetime</strong></p>
| + | | ==, != |
− | </td>
| + | | |
− | </tr>
| + | | |
− | <tr align="left" valign="top">
| + | |- |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">array</strong></p>
| + | | bool |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==, != |
− | </td>
| + | | ==, != |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==, != |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | |- |
− | </td>
| + | | number |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | |
− | </td>
| + | | ==, != |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==, !=, >, <, <=, >= |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==, != |
− | </td>
| + | | |
− | </tr>
| + | | |
− | <tr align="left" valign="top">
| + | |- |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">bool</strong></p>
| + | | question |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | |- |
− | </td>
| + | | range |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==,!= |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | ==, != |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | |
− | </tr>
| + | | |
− | <tr align="left" valign="top">
| + | |- |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">number</strong></p>
| + | | string |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | ==, != |
− | </td>
| + | | ==, != |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=, >, <, <=, >=</p>
| + | | ==, != |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | |- |
− | </td>
| + | | datetime |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | | |
− | </td>
| + | | |
− | </tr>
| + | | ==, !=, >, <, <=, >= |
− | <tr align="left" valign="top">
| + | |} |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">question</strong></p>
| + | |
− | </td>
| + | <br> <br> |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| + | |
− | </td>
| + | The logical operators are shown next: |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">range</strong></p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">string</strong></p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">datetime</strong></p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p>
| |
− | </td>
| |
− | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=, >, <, <=, >=</p>
| |
− | </td> | |
− | </tr>
| |
| | | |
− | </tbody></table>
| + | {| width="1189" cellspacing="0" cellpadding="2" border="1" class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" |
− | <table width="1189" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic">
| + | |- valign="top" align="left" |
− | <tbody><tr align="left" valign="top">
| + | | width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | |
− | <td width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Operator</strong></p>
| + | '''Operator''' |
− | </td>
| |
− | <td width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Meaning</strong></p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">&&</p>
| |
− | </td>
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">Logical and</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">||</p>
| |
− | </td>
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">Logical or</p>
| |
− | </td>
| |
− | </tr>
| |
− | <tr align="left" valign="top">
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">!</p>
| |
− | </td>
| |
− | <td width="594" style="border:1px solid #010101;"><p class="bodytext">Logical negation</p>
| |
− | </td>
| |
− | </tr>
| |
| | | |
− | </tbody></table>
| + | | width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | |
| + | '''Meaning''' |
| + | |
| + | |- valign="top" align="left" |
| + | | width="594" style="border:1px solid #010101;" | |
| + | && |
| + | |
| + | | width="594" style="border:1px solid #010101;" | |
| + | Logical and |
| + | |
| + | |- valign="top" align="left" |
| + | | width="594" style="border:1px solid #010101;" | |
| + | || |
| + | |
| + | | width="594" style="border:1px solid #010101;" | |
| + | Logical or |
| + | |
| + | |- valign="top" align="left" |
| + | | width="594" style="border:1px solid #010101;" | ! |
| + | ! |
| + | Logical negation |
| + | |
| + | |} |
| | | |
− | The outcome of the relational and logical operators is a value of type bool. | + | The outcome of the relational and logical operators is a value of type bool. |
| | | |
| [[Category:Operators]] | | [[Category:Operators]] |