Example: lr_fail_trans_with_errorTransaction Functions

Sets the default status of open transactions to LR_FAIL and sends an error message.

C Language

int lr_fail_trans_with_error( char *format, exp1, exp2,...expn.); 


format A string describing the format to use to write the optional remaining expressions exp1, exp2,.. expn. You may specify a literal string in quotation marks or use the standard Message Formatting that is available for printf.
exp1, exp2,.. expn The optional expressions (variables) to be formatted and printed.

The lr_fail_trans_with_error function sets the default exit status to LR_FAIL for all open transactions with LR_AUTO in their lr_end_transaction statement and sends an error message.

The message is sent to the output window or log file.

A transaction's final status is defined in the status parameter of the lr_end_transaction statement. If this status is LR_AUTO, then the value is automatically assigned. By default the value assigned is LR_PASS, which signifies a successful transaction. lr_fail_trans_with_error changes this default value to LR_FAIL.

Use the format and exp parameters in the same way as the standard Message Formatting that is available for printf. If it is a literal string, enclose it with quotation marks.

Return Values

If this function succeeds, it returns the length of the message that was sent. If the function fails, it returns a negative number.


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