VOC K-type records - Keywords

VOC K-Type Records  -  Keywords

Top  Previous  Next

 

Keywords affect the behaviour of commands or introduce optional components in the command syntax. Keywords are defined by K-type VOC records.

 

1:K  { descriptive text }
2:Keyword number
3:{ alternative expansion }

 

Each keyword is assigned a number which appears in field 2 of a keyword VOC entry.

 

 

Keywords with internal number 0 in field 2 are ignored by the query processor and some other parts of QM. They are provided to allow construction of more natural English sentences. For example, the THAN keyword can be used with other elements such as GREATER and LESS to allow a query such as

LIST STOCK WITH PRICE GREATER THAN 100

instead of

LIST STOCK WITH PRICE GREATER 100

Users can freely add new keywords with internal number 0 as required.

 

 

In some cases, a keyword is also needed as a command name (e.g. OFF which is a synonym for QUIT but also a modifier in several other commands). A keyword can never be the first token in a command. If the command processor finds a K-type VOC item used as the first token in a command, it looks for an alternative VOC record structure starting at field 3.

 

Thus, as an example, the OFF VOC entry reads

1: K

2: 20

3: V

4: IN

5: 1

where fields 3 onwards contain an alternative V-type (verb) definition.

 

 

A summary of K-type VOC records may be displayed or printed using LISTK.