The previous list
does not enumerate all the form-field, global, and local variable references,
which are also significant to the ordered list.
Compiled
References
All library elements
are positionally dependant within the library and type dependant as well,
because the reference to the element assumes a particular type of element
and additionally for variables or form-fields, a data type. This information
is particularly important when other libraries refer back to your library.
The concept of positionally related dependencies between libraries and
datasets are referred to as compiled references. (For more about compiled
references, please see: System 1032 Users Guide, Module 4, page
65, "Using System 1032 Compiled References.")
Updating
a Library
It is customary at
some sites that elements stored in a library are updated using REMOVE
and INSERT commands. When a new element is inserted into a library, the
reference structure must be updated to include all the new element references
that were added at the end of the list.
However, when an
element is removed from the list, it is not merely a matter of deleting
the references to that element. The positions of all the subsequent elements
must still be preserved, because those positions are significant to other
libraries. In other words, compiled references to the remaining elements
must be preserved. (The details of this process are beyond the scope of
this article.)
Therefore, over the
course of many REMOVE and INSERT cycles, the internal structures that
track the components of the internal reference list become increasingly
fragmented. Eventually, this can lead to a situation where an insert into
the library fails.
To resolve errors
that occur during INSERT or REMOVE processing is usually easy: just recreate
the library. This action completely refreshes the internal reference list.
The problems are gone until the next time the reference list becomes too
fragmented again.
Note that the REPLACE
command functionally does a REMOVE followed by an INSERT. However, INSERT
and REMOVE processing allows you to add elements to a library and REPLACE
does not. You can use REPLACE commands to make changes to existing code,
or the non-structural elements of variables, form-fields, and RD fields.
Refreshing
a Library by Recreating It
Library catalogs are
formed in a fashion similar to that of the other System 1032 catalogs,
by using the CREATE command. Use the DESCRIPTION option to read the commands
from a DMD file or use interactive mode to define or import tools. In
either case, first you must be sure to open any other catalogs that are
referenced by the library you want to compile, as shown in Figure 4.
Figure
4. Creating the DIRECTORS_LIB Library
$ s1032 Computer Corporation of America System 1032 Version V9.82-0 Copyright 2007, Computer Corporation of America 1032> 1032> open dataset DIRECTORS in s1032_demo readonly Current dataset is now DIRECTORS 1032> 1032> open lib FORMGEN3 in s1032_tools readonly 1032> 1032> create description DIRECTORS_LIB.DMD output [] 1032> 1032> show library * Library FORMGEN3 Library DIRECTORS_LIB 1032>
|
|
The FORMGEN3 library
contains global variables and procedures used by all FORMGEN-created libraries.
Note in Figure 4
that the more recently created library, the DIRECTORS_LIB library is listed
following the previously opened library(s).
You can also populate
a library using the INSERT command. After creating a simple library as
shown in Figure 5, the INSERT command is used thereafter to add the remaining
elements to the library.
Figure
5. Populating a library via INSERT commands
$ s1032 Computer Corporation of America System 1032 Version V9.82-0 Copyright 2007, Computer Corporation of America 1032> 1032> create library MYLIB 1032 Data Definition Language DDL> variable text_one text varying DDL_ form myform DDL_ FORM statement: field texter text 100 prompt "Enter data" DDL_ FORM statement: end_form DDL_ end_library 1032> 1032> insert in library MYLIB DDL> variable text_two text 355 DDL_ end_insert 1032> 1032> insert in library mylib description myproc.dmc 1032> 1032> show lib MYLIB definition Library MYLIB; Variable TEXT_ONE Text Varying; Form MYFORM Field TEXTER Text 100 Prompt "Enter data" End_Form; Variable TEXT_TWO Text 355; Procedure MYPROC; Variable rightnow date_time Let rightnow = $now write rightnow format("Hello, world, its " d3.3) end_procedure; End_Library; 1032>
|
|