Memory Record


To understand how Sage-ST TM and THOR operate, it is important to understand the concept of the memory record. The memory record is not a physical record, but rather operates like a buffer. The memory record is an area set aside in memory by SAGE to store the image of one record of each relation defined in your schema. The memory record is created by OpenSystem and removed by CloseSystem. The memory record provides access to all data contained in the database -- the means by which data is transmitted between the actual data files and your forms and applications. You cannot access the data files through any other means without violating the integrity of the database.

To establish the link between the memory record and the data files the relation must be opened; however, opening the relation does not affect the memory record. To get a record from the data file to its memory record, you must use a ReadRecord procedure. To get the contents of the memory record back to the data file, you must use the WriteRecord , ReWriteRecord , or DeleteRecord procedures. To break the link, close the relation. Closing the relation does not affect the contents of the memory record; it merely breaks the link to the data files.

The memory record is the link between your monitor and the data. The fields displayed and used on a form in Sage-ST TM are directly tied to the fields in the memory records for the relations (see figure). Therefore, a relation's fields must be defined in the schema before it can be displayed on a form. There are three types of fields that can be used on a form (see figure): display only, display/entry, and highlighted. Each type interacts with the memory record differently. If a field is defined as a highlighted field, then the data written in the highlighted field on the screen is taken and stored in the memory record. In a display only field, the value stored in the memory record is taken and displayed on the screen. A display/entry field is a two-way process. The system takes whatever is stored in the memory record and displays it on the screen. Then the user can type data on the screen and store that data in the memory record. If the displayed form contains all the fields in the memory record, the form will be an exact copy of the memory record.

Figure: Memory Record

The memory record also provides the access between your application and the data files. The GetField procedure gets data from a memory record field and puts it into a variable defined by the programmer. The programmer then may operate at will on the content of the variable. The PutField procedure puts data into the memory record. The data placed in the memory record must be valid with types and constraints declared in THOR. Go Back To Sage-ST TABLE OF CONTENTS


warren.merrill@inl.gov , ftp://sage.inel.gov
Copyright © 1989-2006. Battelle Energy Alliance