Share this page

# lr_param_sprintf

Writes formatted output to a parameter.

    int lr_param_sprintf( const char *paramName, const char * format [,args... ] );

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
paramName | The target parameter to which the string is written.
format | One or more formatting characters.
args | Optional print arguments.

lr_param_sprintf functions like the standard C function sprintf except that the formatted string is written to a parameter instead of a string buffer.

These formatting characters are not supported: %E, %hd, %hhd, %lld, %ld, %hhi, %lli, %hhu , %llu, %hhf , %llf, %hhe, and %lle.

## Return Values

This function returns 0 on success and a non-zero value for failure.

## Parameterization

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

## Example

Copy code

    int index = 56;
    char * suffix = "txt";

    lr_param_sprintf ("LOG_NAME_PARAM", "log_%d.%s", index, suffix,100);
    lr_output_message("The new file name is %s",
        lr_eval_string("{LOG_NAME_PARAM}"));

    Example: Output:
    Action.c(9): The new file name is log_56.txt

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: