15. Embedded Forms Program Structure : How You Implement Keys in an Application
 
Share this page                  
How You Implement Keys in an Application
The process of creating forms applications using an embedded query language consists mainly of defining operations that a user can invoke by pressing a key to manipulate data on a form. Certain operations, such as control of cursor movement, are fundamental to the use of forms and have been predefined in the FRS; these are the FRS statements. Because they are predefined, you can give a user access to any of them by mapping the FRS command to a function or control key (or arrow key in a UNIX or VMS environment) within a mapping file. The user can then press the mapped key to invoke the operation.
For situations in which the predefined FRS statements cannot accomplish the task, you must define an operation within the application and map it to a function key, control key, or arrow key. Two steps are involved:
1. Define an operation in the code and specify the method(s) by which the user can activate it. Only certain types of operations can be invoked by a key.
2. Create a mapping file that is called by the application, which maps the operation to a function key or control key (or to an arrow key in UNIX or VMS environments).
There are three activation methods:
Field activation
Activates an operation by leaving a specified field
Menu item activation
Activates an operation by selecting a menu item on the menu line. If you also map the menu item (by position) to a function, control, or arrow key in the mapping file, the end user can also invoke the operation by pressing the key mapped to that menu item's position, any time that particular key mapping is in effect.
FRS key activation
Activates an operation by pressing a function key, control key, or arrow key mapped to a FRS key. A FRS key operation does not appear as an item on the menu line, unless the application makes the FRS key operation synonymous with a menu item operation.
Any combination of these activation methods can be specified for a single operation. For example, you can define an operation that the end user can activate either by leaving a particular field or by pressing a function key. The statement that defines forms operations in the embedded query language is the activate statement (see your embedded query language reference guide). Following are examples of the two types of operations that, in combination with a mapping file, permit activation by control or function keys of menu item operations and FRS key operations. The examples have each been written in SQL and 4GL. See the section that applies to your operating system.