Dictionary C-type records

Dictionary C-Type Records  -  Calculated Values

Top  Previous  Next

 

A C-type record defines a calculated value and has the definition shown below.

 

1:C  { descriptive text }
2:QMBasic program, multivalued.
3:{ Conversion code }
4:{ Display name. This will be used as the default column heading by the query processor. A special value of a backslash character can be used to specify that no heading is to be displayed. The text can commence with 'R'  (including the quotes) to right justify the heading, 'X' to suppress the normal dot filler characters, or 'RX' to apply both modifications. If the display name is multivalued, each value appears as a separate line.}
5:Format specification
6:Single/multivalue flag. Set as S if the field is always single valued or M if it can be multivalued.
7:{ Association name. Where a multivalued field has a value by value relationship with some other multivalued field defined in the same dictionary, this name links the fields together. See Associations for more details. }
8:Available for user use in any way. Not referenced by QM.
9-10:Reserved for internal use.
11:Available for user use in any way. Not referenced by QM.

Fields 12 onwards are reserved for internal use and users should not assume anything about their content.

 

 

A C-type dictionary item is a QMBasic program written with each line of the program as a separate value in field 2. The EV (edit values) command of ED may help in editing this field. The Dive function of SED provides similar functionality.

 

The program must return a result via the @ANS variable. This variable is initially zero on entry to QM, is automatically updated to contain the result of I-type expressions and should be updated by C-types. Although it is possible to use @ANS to pass a value from evaluation of one C or I-type item to the next, this is not recommended as the sequence of execution may be indeterminate.

 

The program can reference data defined by other items in the same dictionary using the {name} construct where name is an A, C, D, I or S-type item.

 

A $BASIC.OPTIONS record in the dictionary or in the VOC may affect compilation of C-type items.

 

C-type programs may not use the following QMBasic components:

$CATALOGUE

$DEBUG

$QMCALL

CLASS

DEBUG

FUNCTION

PROGRAM

SUBROUTINE