Share this page

# lr_eval_string

Returns the string argument after evaluating embedded parameters.

    char *lr_eval_string( char *instring  );

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
instring | The string to evaluate.

The lr_eval_string function returns the input string after evaluating any embedded parameters. If the string argument contains only a parameter, the function returns the current value of the parameter.

Embedded parameters must be in brackets.

Note: lr_eval_string allocates memory internally. The memory is automatically freed at the end of each iteration. You can use lr_eval_string_ext to manually free the memory in each iteration with lr_eval_string_ext_free. Do not, however, use a free statement in your custom code, as this may result in memory corruption.

## Return Values

This function returns the value of the specified string, provided that the parameter was previously captured in the returning payload. It returns NULL upon failure.

## Parameterization

All arguments can be parameterized using standard parameterization.

## Example

In the following example, lr_eval_string is used to check the value of a parameter.

Copy code

    Action()
    {
        lr_save_int(0, "searchCount");
        if (atoi(lr_eval_string("{searchCount}") ) == 0) {

            lr_output_message("Is zero, %s",  lr_eval_string("{searchCount}"));
        }

        lr_save_int(47, "searchCount");
        if (atoi(lr_eval_string("{searchCount}") ) != 0) {
            lr_output_message("Not zero, %s",  lr_eval_string("{searchCount}"));
        }

        return 0;
    }

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: