Example: lrd_to_printable

In the following example, lrd_to_printable tells VuGen to display two columns in the grid. In the first column it displays the NAME and in the second column it displays the ID.

The first segment shows the recorded script in the Actions section. The second segment shows the corresponding section (PrintRow14) in the print.inl file generated during recording.

 /* Actions section from run.c */
unsigned int msg;
lrd_stmt(Csr1, "select * from Employees", -1, 1, 1, 0);
lrd_bind_col(Csr1, 1, &NAME_D11, 0, 0);
lrd_bind_col(Csr1, 2, &ID_D12, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 1);
/* Set the log level to enable lrd_to_printable
    before the lrd_fetch */
msg = lr_get_debug_message();
lr_set_debug_message
  (msg|LR_MSG_CLASS_EXTENDED_LOG|LR_MSG_CLASS_RESULT_DATA,
  LR_SWITCH_ON);
lrd_fetch(Csr1, -3, 15, 0, PrintRow14, 0);
/* Restore the log level */
lr_set_debug_message(msg, LR_SWITCH_ON);

 
NAME_D11
ID_D12
1
Kim Smith
200
2
Janet Jones
201
3
Annette Taylor
202
 / * PrintRow1 section from print.inl. */
LRD_PRINT_ROW_PROTO(PrintRow14)
{
 LRDRET gjLRDRet = LRDRET_I_OK;
 char szNAME_D11[256];
 char szID_D12[256];
lrd_to_printable(&NAME_D11, muliRowIndex, szNAME_D11, 256, "");
lrd_to_printable(&ID_D12, muliRowIndex, szID_D12, 256, "");
 lr_debug_message(LR_MSG_CLASS_RESULT_DATA, "%s, %s", szNAME_D11, szID_D12);
 return gjLRDRet;
}