Database Vuser Functions (LRD) > Alphabetical List of Functions > lrd_to_printable


Example: lrd_to_printable Variable Handling Functions

Converts a variable to a printable string.

LRDRET lrd_to_printable( LRD_VAR_DESC *mptVarDesc, unsigned long muliIndex, char *mpszOutputStr, unsigned long muliOutputStrSize, char *mpszOutputStrFmt );

mptVarDesc A pointer to the descriptor of the variable being converted.
muliIndex The index of the element to be converted in an array (zero for a simple variable).
mpszOutputStr A pointer to the area to contain the returned string.
muliOutputStrSize The amount of storage allocated for the result string.
mpszOutputStrFmt A pointer to a string specifying the output format. Only LRD_OUTPUT_STR_FMT_DFLT is available.

The lrd_to_printable function converts a variable or an array element to a printable string. This function is generated during recording in the print.inl file located in the script directory. It provides information on how to display the results in VuGen's grid.

lrd_to_printable is used in the automatically generated PrintRow<N> functions in print.inl that are passed as callback functions to lrd_fetch* functions. lrd_to_printable converts the data only if the the Log run-time settings Extended log and Data returned by server are set. They can be set in the script by ORing the current log level with LR_MSG_CLASS_EXTENDED_LOG and LR_MSG_CLASS_RESULT_DATA. See the example.

When you access data using lrd_bind_col, you use lrd_to_printable to convert data that cannot be printed in its original type (for example a fixed length character string that is not null-terminated). You must repeat this function for every row that is retrieved by lrd_fetch.

When you access data with lrd_col_data, you call lrd_to_printable to convert the data into a printable string, regardless of the data type.

For more details refer to the Function Header File lrd.h in the include directory.

Return Values

See LRD Return Values.


You cannot use standard parameterization for any arguments in this function.