FOCUS Language

The difference between the terms procedural and non-procedural is worth discussing briefly. The basic distinction is that non-procedural languages allow the person making a request to concentrate on what needs to be done, rather than how to do it. Non-procedural languages free you from the constraints of specifying, in a predetermined way, how to process data. FOCUS takes you a level away from what the computer is doing from moment to moment, allowing you to concentrate on specifying what you wish to accomplish, such as print a report, update a data source, create a graph, or build an entry screen.

Procedural languages, such as COBOL and PL/1, require that you specify how to process the data. For example, to create a simple report showing salaries by department, you would write explicit instructions to:

  1. Open the data source.
  2. Sort the data source (by DEPARTMENT).
  3. Read a record. When there are no more records, go to Summary (below).
  4. Extract the values for SALARY and DEPARTMENT.
  5. Accumulate field totals.
  6. Move the fields to the output positions.
  7. Write a record.
  8. Go back to read another record.
  9. Carry out a summary (write report totals).
  10. Close data sources and stop.

The same request in FOCUS might read:

TABLE FILE filename 
SUM SALARY COLUMN-TOTAL
BY DEPARTMENT
END

You can develop highly complex applications in FOCUS, with sophisticated interactive dialogues and processing flows that depend on internal testing of values that you (or another user) supply at run time. These applications comprise non-procedural request elements interspersed with procedural control statements from Dialogue Manager.

The procedures that combine non-procedural request elements and procedural control statements are called FOCEXECs (FOCUS executable procedures), and they can be characterized as quasi-procedural. They still employ the simple request elements, but add procedural control elements to dictate when and under what conditions the request portions will be executed.

In one system, FOCUS provides a convenient means of specifying what you wish to do, together with the procedural controls necessary for building complete applications.

FOCUS consists of several integrated functional environments. TABLE, for example, accommodates commands for requesting tabular reports, while MODIFY works with commands used to add, delete, or change (modify) data.

Each level or environment has a command set that applies specifically to that environment. You will quickly learn to distinguish between environments, but even if you forget where you are, you can have FOCUS display the active environment by pressing Enter without typing anything on the command entry line. If you are in FOCUS, but not in a particular command environment, the word "FOCUS:" appears followed by the system prompt symbol.


Information Builders