Dictionary C-Type Records  -  Calculated Values

Top  Previous  Next

 

A C-type record defines a calculated value and has up to 8 fields:

 

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.}
5:Format specification
6:Single/multi-value flag. Set as S if the field is always single valued or M if it can be multi-valued.
7:{ Association name. Where a multi-valued field has a value by value relationship with some other multi-valued 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.}

 

Fields 9 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 a C-type, D-type or I-type item.

 

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

$CATALOGUE

$DEBUG

$QMCALL

CLASS

DEBUG

FUNCTION

PROGRAM

SUBROUTINE