QMEvaluate(), QMEvalConv()

QMEvaluate(), QMEvalConv()

Top  Previous  Next

 

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.

 

The function arguments are:

 

FileNois the file number associated with the dictionary of the file, as returned by QMOpen().

 

Nameis the name of the dictionary I-type record. This may be multi-valued as described below.

 

Datais the data from the record for which the I-type is to be evaluated. This data will  be copied into @RECORD on the server.

 

Idis record id of the record for which the I-type is to be evaluated. This data will  be copied into @ID on the server. If the I-type expression does not reference  @ID, this is ignored and is best passed as a null string.

 

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 will be compiled automatically if required. A compilation error will return a server status value of SV$ERROR.

 

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).

 

If name is multi-valued, the function evaluates each item in turn, building a composite result string with an item mark character between each returned item.

 

The example program fragments below open 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 these examples would return OrderValue as the result of evaluating the SALE.VALUE dictionary item and then applying any conversion code.

 

 

hmtoggle_plus1C

 

hmtoggle_plus1VB.Net

 

hmtoggle_plus1QMBasic Class Module

 

hmtoggle_plus1Java

 

hmtoggle_plus1Python