Each standard expression consists of a simple expression. The tables below show the grammar that you can use for creating standard expressions:
| <expression> ::= |  <simple-expression> [ ( "=" | "<>" | "<" | "<=" | ">" | ">=" ) <simple-expression> ] | 
| <simple-expression> ::= |  [ "+" | "-" ] <term> [ ( "+" | "-" | OR ) <term> ] | 
| <term> ::= |  <factor> [ ( "*" | "/" | MOD | AND | XOR ) <factor> ] | 
| <factor> ::= |  [ NOT | "+" | "-" ] ( <function> | "(" <expression> ")" | <boolean> | <integer> | <real> | <date-time> | <string> | <tag> | <cell> | <cell-block> | <field> | <field-block> |) | 
| <function> ::= | <function-name> "(" [ <expression> { "," <expression> } ] ")" | 
| <boolean> ::= | TRUE | FALSE | 
| <integer> ::= | <digit> { <digit> } | 
| <digit> ::= | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | 
| <real> ::= | [ <integer> ] "." <integer> [ <exponent> ] | <integer> <exponent> | 
| <exponent> ::= | ( "E" | "e" ) [ "+" | "-" ] <integer> | 
| <date-time> ::= | "#" ( <date> | <time> | <date> " " <time> ) "#" | 
| <date> ::= | <short-date> | <long-date> | 
| <short-date> ::= | <day> "/" <month-number> "/" <year> | 
| <long-date> ::= | <day> " " <month-name> " " <year> | 
| <year> ::= | <digit> <digit> [ <digit> <digit> ] | 
| <time> ::= | <hours> ":" <minutes> [ ":" <seconds> [ <fraction> ] ] | 
| <fraction> ::= | "." <digit> [ <digit> [ <digit> ] ] | 
| <string> ::= | "'" <text> "'" | 
In addition to the grammar shown above, you can use the following grammar in expressions other than Template expressions:
NOTE: Tags do not apply to Template expressions, instead you use Template Parameters.
| <tag> ::= | """ ( <relative-tag> | [ <system-name> ":" ]  | 
| <relative-tag> ::= | "." { "." } ( <data-tag> | <historic-tag> |  | 
| <absolute-tag> ::= | <data-tag> | <historic-tag> | <historic-calc-tag> | <server-status-tag> | <register-tag> | 
| <data-tag> ::= | ( <item> | <search-key> ) [ "." ( <property-name> | <method-name> "(" [ <expression> { "," <expression> } ] ")" ) ] | 
| <historic-tag> ::= | ( <item> | <search-key> ) [ "."  | 
| <historic-calc-tag> ::= | ( <item> | <search-key> ) [ "."  | 
| <item> ::= | ( <group> | [ <group> "." ] <item-name> ) [ "."  | 
| <group> ::= | <group-name> [ "." <group> ] | 
| <server-status-tag> ::= | "#" <status-tab-name> "." <status-key> "."  | 
Where:
- <aggregate-name>is the name of an aggregate of an item in the database
- <cell> is a cell in a Data Grid. This only applies to expressions that are associated with Data Grids (see Data Grid Expressions).
- <cell-block> is a block of cells in a Data Grid. This only applies to expressions that are associated with Data Grids (see Data Grid Expressions).
- <day>is the day of the month, from 1 to 31
- <field>is the name of a field in a Data Set. This only applies to expressions that are associated with Data Sets (see Data Set Expressions).
- <field-block> is a block of fields in a Data Set. This only applies to expressions that are associated with Data Sets (see Data Set Expressions).
- <function-name>is the name of any built in function (see Functions)
- <group-name>is the name of a group in the database
- <month-name>is either the full month name (for example, October) or short month name (for example, Oct)
- <month-number>is the month number, from 1 to 12
- <historic-algorithm-name>is the name of a historic algorithm of an item in the database (this can only be omitted when the item has exactly one historic algorithm)
- <hours>is a number from 0 to 23
- <interval>is an OPC time (see Using OPC Time Formats in the Geo SCADA Expert Guide to Core Configuration)
- <item-name>is the name of an item in the database
- <method-name>is the name a method of an item or aggregate in the database
- <minutes>is a number from 0 to 59
- <parameter-name>is the full name (including group(s)) of a Mimic parameter. This is only applicable to expressions on Mimics (see the Geo SCADA Expert Guide to Mimics)
- <property-name>is the name of a property of an item or aggregate in the database
- <opc-aggregate>is the name of an OPC HDA aggregate (see OPC Historic Tags)
- <relative-time>is an OPC relative time (see Using OPC Time Formats in the Geo SCADA Expert Guide to Core Configuration)
- <search-key>is the value of a database search key (see Search Key Tags)
- <seconds>is a number from 0 to 59
- <status-key>is the key value of a row in a server status tab (see Server Status Property Tags)
- <status-property-name>is the name of a property of a server status tab (see Server Status Property Tags)
- <status-tab-name>is the name of a server status tab (see Server Status Property Tags)
- <system-name>is the name of a system available to ViewX (this only applies to in expressions that are evaluated by ViewX clients). A system is a Geo SCADA Expert database
- <text>is any literal text (if the text includes the single quotation character ', the character has to be replaced by two ' characters).
You can also include comments in your expressions. Usually, comments are used to provide a brief description of the code so that other users can quickly determine its purpose. You can add comments to any part of the expression code (see Comments in Expressions).