Sets and vectors

Very often a label is followed by two or more fields. Structures like these are sometimes called "vectors". They are very useful when two or more values must remain closely associated (for example a numerical value and its error).

Vectors have the ability to form sets. To explore what this means, consider the following modification to the ?TShirt model. We modify the structure

           Remarks Text
to convert it into a vector

           Remarks Int Text //year and remark
The intention is to identify all remarks with the year in which they were made.

The fields in a vector must be filled in from left to right. That is, you cannot enter data into the Text field unless the Int field is also filled. Null (blank) values will work for Text fields, but see this note before using them.

Now we enter the following data:

TShirt : sam05
Remarks 1990 "Great Shirt!"
Remarks 1991 "Sarah dislikes color"
Remarks 1991 "Sarah hid it in the trash!"
Remarks 1992 "Joyce likes it!"
The corresponding text window is:

As expected, the years and remarks appear side-by-side. But notice how ACEDB handles the text following "1991". There are two remarks associated with this year and they form their own list, nested inside the overall list for years and remarks. A vector has the potential to create nested sets with as many levels as there are fields in the vector.

Sets are filled out first come, first serve; when subsets are created, this same rule follows. Thus if later we add

TShirt : sam05
Remarks 1991 "Sarah dyed it green"
it is added next in line in the "1991" category as the display shows

Entry order, as it is reflected in the window, is still an issue. Had we entered this instead:

TShirt : sam05
Remarks 1991 "Sarah hid it in the trash!"
Remarks 1990 "Great Shirt!"
Remarks 1992 "Joyce likes it!"
Remarks 1991 "Sarah dislikes color"
we would see


Show me the whole t-shirt model again.

Back to Table of Contents