DBGetResultHandler
The DBGetResultHandler function returns a pointer to a result handler for a specified data type.
FUNCTION DBGetResultHandler (dataType: DBType;
VAR theHandler: ProcPtr;
getSysHandler: Boolean): OSErr;
dataType
- The data type for which to install a result handler.
theHandler
- Returns a pointer to the result handler.
getSysHandler
- If you set the
getSysHandler parameter to FALSE (0), the function returns a pointer to the current application result handler for the specified data type, or it returns NIL if there is no application result handler for that data type. If you set the getSysHandler parameter to TRUE (nonzero), the function returns a pointer to the current system result handler for the specified data type, or it returns NIL if there is no system result handler for that data type.
DESCRIPTION
You can use the DBGetResultHandler function to obtain a pointer to a result handler so that you can use it to convert to text an individual data item retrieved by the DBGetItem function. The DBGetQueryResults function automatically converts to text all of the data pointed to by the results record.
SPECIAL CONSIDERATIONS
The DBGetResultHandler function may move or purge memory. You should not call this routine from within an interrupt, such as in a completion routine or a VBL task.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the DBGetResultHandler function are
| Trap macro | Selector |
| _DBGetResultHandler | $0516 |
RESULT CODES
| noErr | 0 | No error |
| rcDBNoHandler | -811 | There is no handler for this data type installed for the current application |
| rcDBPackNotInited | -813 | The InitDBPack function has not yet been called |
SEE ALSO
The DBGetQueryResults function is described on page 12-66, and the DBGetItem function is described on page 12-84. See "Converting Query Results to Text" beginning on page 12-43 for a list of the data types for which Apple provides system result handlers. Listing 12-6 on page 12-46 shows a sample result handler.