The VOC File |
![]() ![]() ![]() |
The VOC file is central to everything that QM does. This file is the vocabulary of words and symbols that may appear in commands and holds many other things as well. The initial VOC file is a copy of NEWVOC from the QMSYS directory. By modifying the VOC it is possible to change the names of commands to meet particular needs of an application or user. It would be possible, for example, to include French translations of all the command names. More often, changes are made simply to use wording that is more appropriate to the manner in which the product is used.
Records in the VOC are of differing types, the type of the record being determined by the first one or two characters of field 1 of the record. The remainder of field 1 after the identifying characters may contain any value and is typically used to comment the role of the VOC entry.
The VOC record types are
Defines a field within a data file. D type entries may appear in the VOC but are more commonly found in dictionaries.
Defines a file, relating its application level name for use within QM to its operating system pathname.
Many commands have keywords which affect the behaviour of the command or introduce optional clauses in the command syntax.
A menu record defines a menu that can be displayed by executing the VOC entry.
A paragraph is a sequence of commands that can be executed by entering the name of the VOC entry.
A phrase is a short form for a sequence of items to be substituted into query processor commands.
A PROC is the predecessor of paragraphs. QM supports PQN style PROCs for use when migrating applications. It is recommended that new developments should use paragraphs or QMBasic programs instead.
A remote file pointer refers to a file in another QM account, perhaps on a different server.
An R type VOC entry points to a record in another file which is constructed in the same way as an executable (M, PA, R, S or V type) VOC entry.
A sentence is a single command.
A verb is the portion of a command which identifies the part of QM which will process it.
X type records may be used to store miscellaneous information in the VOC.
Users may add handlers for other VOC record types that are to be usable as commands. This is done by creating a VOC record named $VOC.PARSER: Field 1 X Field 2 A multivalued list of VOC record type codes. Field 3 A corresponding multivalued list of catalogued handler subroutine names.
The handler is a QMBasic subroutine taking two arguments; the verb name and the VOC record.
The VOC includes an F-type entry referencing itself so that commands that access the VOC do not have to treat it as a special case. Users must not modify this VOC entry as any change is likely to cause QM to malfunction because internal components reference the VOC by pathname.
The VOC also includes a Q-type entry named MD as a synonym for VOC for compatibility with other systems.
|