QMTrans(), QMRTrans()

QMTrans(), QMRTrans()

Top  Previous  Next

 

The QMTrans() function performs the equivalent of a QMBasic TRANS() function on the server.

 

 

The function arguments are:

 

FileNameis the name of the file from which data is to be read.

 

Idis the id of the record to be read. This may be a multivalued list of record ids.

 

FieldNameis the dictionary name of the field to be returned. The dictionary record may be any valid data defining item (types A, C, D, E, I, S). Alternatively, FieldName may be specified as a numeric field position or -1 to return the entire record.

 

Actionsets the action to be taken if the data cannot be found:
CReturn the record id.
XReturn a null value.

In addition,

BCauses the file to be opened in binary mode with mark mapping disabled.

 

 

The QMTrans() function causes the server process to open the data file and its dictionary, execute a QMBasic TRANS() function and return the result.

 

The QMTrans() function returns the specified data with any mark characters lowered by one level (e.g. value marks become subvalue marks).

 

If record.id is multivalued, the QMTrans() function extracts each requested record and returns a multivalued result with the data from each record separated by a value mark.

 

The QMRTrans() function is identical to QMTrans() except that it does not lower the mark characters. This makes it impossible to distinguish between the results of retrieving a multivalued field from a single record and retrieving a single valued field from multiple records.

 

 

The example program fragments below are based on the QM demonstration database and use the QMTrans() function to fetch the current price for the parts in an order from the STOCK file.

 

 

hmtoggle_plus1C

 

hmtoggle_plus1VB.Net

 

hmtoggle_plus1QMBasic Class Module

 

hmtoggle_plus1Java

 

hmtoggle_plus1Python

 

 

See also:

QMEvaluate()