URL: http://www.firstbasesoftware.com/man/man5/view.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
The view dictionary is a standard text file consisting of entries describing a single display unit on the terminal screen. Each entry is on a separate line and is basically of the form subject@coordinates, meaning 'place subject at coordinates on the terminal screen'. Syntactically, each entry must appear in one of the following formats:
a) $PAGE b) "Text Text Text"@row,col c) FieldName@row,col d) FieldName[sub1-sub2]@row,col e) FieldName[display_size]@row,col f) FieldName[sub_element:display_size]@row,col g) $HELP helpfile
Note: blanks are not accepted in an entry except within literal quotes. The following list describes the parts of each entry.
If a field name is used, it must exist in the formal database dictionary. If the true field name has embedded blanks, underscores must be used in the view dictionary.
A couple of special items pertain to mapping fields onto the view surface. One is that substring limitations may be applied to any alpha field. This format is shown in item (d) above.
All substrings are used in array style format, with an array that starts at position one. For example, the subject entry Field1[1-20] will edit only the first 20 characters of the contents of Field1 in each record.
Another special item concerning field displays is that fields with sizes greater than 80 characters that are not being used as a substring are depicted as being only a single character wide. Alternately, item format (e) above shows how a display size can be set for use with these long fields.
These long fields are handled either by the internal editor (for those fields smaller than 300 characters), or by the user defined visual editor (for those fields greater than 300 characters). Of course, the display command ('d') will still display these fields.
Still yet another special item about field displays concerns sub_element display. These elements, described by format (f) above, are an array of elements that start at element 1 through the number of elements. In other words, these elements (attributes or sub-fields of the entire field) can be displayed independent of one another -- these sub-fields are individually accessible.
There are two kinds of sub_elements: those making up a nested choice field, and those NEWLINE terminated lines of text from large text fields.
For example, assuming Field1 is a choice field with a nested choice file, Field1[3:10] would return the 3rd choice attribute, and display it in a 10 character screen area. Or, if Field1 is a long alpha field, then Field1[3:70] would return the 3rd line of text -- as defined by true NEWLINE characters -- and display it in a 70 character wide field. (Also, see the HINT below).
In addition, the numeric variable for sub_element display can be a negative number which translates into an element or line derived by counting backwards from the end of the field. For example, Field1[-5:70] would return the fifth line up from the end of the field.
There are two additional features that are encoded into each view dictionary entry. In the syntax list above, a @ character is used to separate the subject from the coordinates. There is another choice. If the @ character is used, the entry is depicted in reverse video. Alternately, a : character can be used to display the entry in normal video mode.
The second encoded option is the ability to make a field display-only. This feature can be used to put a few common fields on each edit page in order to retain continuity. These fields could be editable on the first page, and display-only on the subsequent pages. To encode this display-only mode, make at least one of the <x,y> coordinates negative. For example, Field1@5,-1.
HINT: A hint for editing long "visual" fields, fields edited using a UNIX editor. Use sub_element display and map some lines of the text field in display-only mode, one per line, 79 characters long. Then, map an editable copy of the same field to the first row, first column, and let it default to a single character wide. As in the following example:
"Text Field"@10,1 text_field@11,1 text_field[1:79]@11,-1 text_field[2:79]@12,-1 text_field[3:79]@13,-1
Two meta view dictionary entries also exist. $PAGE is used to begin a new view page. The first view page does not need to be marked. The other meta entry allows custom help files to be tied to each view page. The form of this meta entry is $HELP helpfile, and can only be used after the first entry of a page is used. I.E., do not place a $HELP after a $PAGE without some other non-meta entry in between.
Unlike all other FirstBase dictionaries, there is not a view dictionary editor. The view dictionaries are created using any text editor. The extension of this file must be .vdict, thus the default view dictionary is dbase.vdict.
NOTE: in the FirstBase view dictionary file names are used to specify helpfiles. When dbvedit(1) is invoked, if the working database is in a different directory, these file names are expanded to reflect the working directory. File names beginning with a dot (.) or a slash (/) will not be expanded.
FirstBase User's Guide and Reference Manual