Was this helpful?
4GL Statements and Coding Techniques
The following table summarizes some of the 4GL statements and coding techniques used by the Employees application. In most cases, the statements and techniques are indicated by comments in the actual code. Some of the features are also described in the sections about specific frames or procedures.
Statement or Technique
Description
Where Used
insert, update, and delete statements
These statements manipulate data in the Employees, Employee_ histories, or Positions table.
Employees and Positions frames
dbmsinfo ('username') function
This function retrieves
the name of the current Ingres user as the value to be entered into the "last_updated_by" column of the Employees or Positions table.
Employees and Positions frames
look_up built-in frame with a query
A select statement is
used to populate the lookup table with data from the Positions table. The lookup table ensures the validity of a user-specified position code, and obtains the corresponding position description.
Employees frame
look_up built-in frame with an array
The procedure uses an array of a record type (see Global Objects) to populate the confirmation pop-up.
Confirm procedure
length, left, right, and locate functions
These built-in 4GL functions are used to place text within the array.
Confirm procedure
Local procedures
These procedures perform a variety of processing and checking functions for a frame. The code for each procedure is included at the end of the source code file for the relevant frame.
Employees and Positions frames
Local variables
The procedures are described in the declare section of the initialize block of the code, rather than in the parameter list of the initialize block, to ensure that they are not passed inadvertently as parameters in a callframe or callproc statement.
Employees and Positions frames
Global variables
These variables are used at various places in the application; see Global Objects.
Employees and Positions frames
Table field menu frame
The table field presents user options in the top frame.
Topframe frame
loadtable table field statement
This statement enters into the table field the names and descriptions of the frames the user can call.
Topframe frame
inittable table field statement
This statement makes the table field read only.
Topframe frame
insertrow and deleterow statements
These statements add to or delete from the database any table field rows that the user has updated or deleted, respectively.
Employees and Positions frames
unloadtable table field statement
This statement updates a table with data that a user has saved in a table field.
Employees and Positions frames
Manipulating the display mode of forms and fields
This feature lets you control the user's ability to manipulate data at various points in the application.
Employees and Positions frames
Manipulating the change bit of a form or row
This feature lets the application execute specific code based on whether the user has saved any changed data.
Employees and Positions frames
Submenus
Submenus let the user perform various operations after selecting data.
Employees and Positions frames
resume statement
This statement returns the cursor to the correct field and transfers control after an error has occurred.
Employees and Positions frames
select to simple fields
This statement retrieves data from the Employees table into the simple fields of the form.
Employees frame
Master/Detail select
This statement retrieves an Employee record and all corresponding Employee_histories records into the simple fields and table field columns of the form.
Employees frame
select to a complex object
This statement retrieves records into the table field in which the Positions table is displayed.
Positions frame
file access functions
These statements allow data transfer between a field and an ASCII text file on disk.
Descriptions frame
callframe byref
This statement calls a frame and passes the description information by reference.
Positions frame
Qualifications in simple fields
You can let users enter a qualification into any of the fields of the Employees table (except the display-only fields) to display specific records from the Employees table.
Employees frame
Qualifications in a table field
You can let users enter a specific position code or description, or use a pattern-matching or wildcard character in the "Position Description" column, to display specific records from the Positions table.
Positions frame
Last modified date: 11/09/2022