The openUI statement allows the user to interact with a program whose interface is based on Console UI. The statement defines user and program events and specifies how to respond to each.
You can end an openUI statement by issuing an exit openUI statement.

For details on binding, see the description of the OnEventBlock parameter, as well as the topic "Console UI parts and related variables."
onEvent(eventKind: eventQualifiers)
The EGL statements that respond to a given event are between the onEvent header and the next onEvent header (if any), as shown in a later example. However, you cannot include a reference variable in the onEvent block unless that variable was declared as a program global.
No event block is available for a window.
ON_KEY:("a", "ESC")
This event is available in an ArrayDictionary, a ConsoleField, a Menu, or a Prompt.
BEFORE_FIELD:("field01", "field02")
AFTER_FIELD:("field01", "field02")
The user can edit the row before committing changes to a database, as typically happens in the AFTER_INSERT handler.
MENU_ACTION:("item01", "item02")
You associate a consoleField with an SQL table column by setting the SQLColumnName consoleField property; and you must set the dataType consoleField property, as noted in dataType.
> 25
= 'Sarasota'
AGE > 28 AND CITY = 'Sarasota'
As shown, EGL places the operator AND between each clause that the user provides.
The next table shows valid user input and the resulting clause. The phrase "simple SQL types" refers to SQL types that are neither structured nor LOB-like types.
| Symbol | Definition | Supported data types | Example | Resulting clause (for a character column named C) | Resulting clause (for a numeric column named C) |
|---|---|---|---|---|---|
| = | Equal to | Simple SQL Types | =x, ==x | C = 'x' | C = x |
| > | Greater than | Simple SQL Types | >x | C > 'x' | C > x |
| < | Less than | Simple SQL Types | <x | C < 'x' | C < x |
| >= | Not less than | Simple SQL Types | >=x | C >= 'x' | C >= x |
| <= | Not greater than | Simple SQL Types | <=x | C <= 'x' | C <= x |
| <> or != | Not equal to | Simple SQL Types | <>x or !=x | C != 'x' | C != x |
| .. | Range | Simple SQL Types | x.y or x..y | C BETWEEN 'x' AND 'y' | C BETWEEN x AND y |
| * | Wildcard for String (as described in next table) | CHAR | *x or x* or *x* | C MATCHES '*x' | not applicable |
| ? | Single character wildcard (as described in next table) | CHAR | ?x, x?, ?x?, x?? | C MATCHES '?x' | not applicable |
| | | Logical Or | Simple SQL Types | x|y | C IN ('x', 'y') | C IN (x, y) |
The equal sign (=) can mean "has a null value," and the not-equal sign (!= or <>) can mean "does not have a null value."
A MATCHES clause results from the user's specifying one of the wildcard characters described in the next table.
| Symbol | Effect |
| * | Matches zero or more characters. |
| ? | Matches any single character. |
| [ ] | Matches any enclosed character. |
| - (hyphen) | When used between characters inside brackets, a hyphen matches any character in the range between and including the two characters. For example, [a-z] matches any lowercase letter or special character in the lower case range. |
| ^ | When used in brackets, an initial caret matches any character not included within the brackets. For example, [^abc] matches any character except a, b, or c. |
| \ | Is the default escape character; the next character is a literal. Allows any of the wildcard characters to be included in the string without having the wildcard effect. |
| Any other character outside of brackets | Must match exactly. |
openUI {bindingByName=yes}
activeForm
bind firstName, lastName, ID
OnEvent(AFTER_FIELD:"ID")
if (employeeID == 700)
firstName = "Angela";
lastName = "Smith";
end
end