QMEvaluate(), QMEvalConv() |
|
|
The QMEvaluate() function evaluates a dictionary data defining item. It is analogous to the QMBasic ITYPE() function. The QMEvalConv() function is identical except that it applies any conversion code specified in the dictionary item.
Format
where
The QMEvaluate() function evaluates the specified dictionary expression. Like the QMBasic ITYPE() function, it can evaluate all data defining dictionary items(A/C/D/I/S type). Where the dictionary item is a calculated value (C/I type or A/S type with correlative), it must have previously been compiled (see the COMPILE.DICT command).
The QMEvaluate() function evaluates the data item but does not apply any conversion and format codes specified in the dictionary. The QMEvalConv() function applies conversion codes to the evaluated item but not format codes.
Because the QMEvaluate() function must read the dictionary record every time that it is evaluated, applications that execute this function in a loop for many records using the same dictionary item are likely to perform best if record caching is enabled (See the RECCACHE configuration parameter).
Examples
The above program fragment opens the data and dictionary parts of the SALES file, reads a data record, and evaluates the SALE.VALUE dictionary item without applying the associated conversion code, if present. A real program should include error handling.
Using QMEvalConv() in place of QMEvaluate() in the above examples would return OrderValue as the result of evaluating the SALE.VALUE dictionary item and then applying any conversion code.
|