Progress
Language Tutorial
for Windows


How Progress Stores and Moves Data

Before discussing the Progress language statements that manipulate data, it’s helpful to know the main locations where Progress stores data. Once you understand where your data is, it’s easier to visualize how Progress statements change or move that data.

To start working with data, you first have to copy it from the database. The database is the first data location.

When your procedure copies data from a database, Progress stores that data in memory. An area of memory used to store data is called a buffer. When you request data from a database record, Progress places a copy of the entire database record or a group of fields from the record (called a field list) in a buffer. These buffers are called record buffers.

For each table that you work with, Progress creates and maintains a separate record buffer. In general, you won’t have to work directly with record buffers. Progress understands what to do with the buffers based on your code.

Before your end users can view or work with data, that data has to be visible on the screen. Data visible on screen is also stored in memory. Memory reserved for on-screen data is called a screen buffer. As with record buffers, Progress maintains screen buffers for you.

Figure 8–1 shows the icons that the tutorial uses to represent these data locations.

Figure 8–1: Data Locations

These data locations are important to understand because they relate to three fundamental rules of data movement in Progress. The following list describes these rules of data movement:

  1. Your procedure cannot interact with data until the procedure copies the data from the database to a record buffer. Once in the record buffer, the procedure can manipulate that data.
  2. End users cannot interact with data until your procedure copies the data from the record buffer to the screen buffer. Once in the screen buffer, the data is visible on screen.
  3. Progress does not automatically copy changes made in a screen buffer or a record buffer to the related buffer. For example, if a copy of a particular field exists in both a record buffer and a screen buffer, changing the data in the screen buffer does not change the data in the record buffer. Your procedure programmatically controls the movement of data between buffers.

Think of the data locations as stops along a two-way street. To display a database record, Progress must first move it to a record buffer and then into a screen buffer. Similarly, Progress cannot write new screen buffer data to a database without first writing it to a record buffer. Figure 8–2 shows how data moves in Progress.

Figure 8–2: Data Movement in Progress

Up to this point, the tutorial used the terms “underlying value” to refer to a record buffer value and “screen value” to refer to a screen buffer value. (The screen value of a widget is a screen buffer value.)

Notice the distinction in Figure 8–2 between batch and user manipulation. If you write a procedure that processes records behind the scenes, then your procedure works exclusively with record buffers. If you write a procedure that allows users to interact with the data, the procedure also works with screen buffers. At some point, your interactive procedure copies data between the screen buffers and record buffers. This chapter focuses on the techniques of interactive database access.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095