Share this page

# lr.advance_param

Advances to the next available parameter value.

## JavaScript

    function lr.advance_param(  parameter  )

## VBScript

    Function lr.advance_param(  parameter  )

String and Parameter Functions

## Arguments

Name | Comments
--- | ---
param | The name of the parameter in quotes (no brackets).

The lr.advance_param function causes the script to use the next available value of the parameter. If you are running multiple iterations, you can specify in the parameter properties to advance automatically to the next value for each iteration. Use this function within an iteration to advance to the next value.

The effect on other parameters in the same data file depends on the settings in the Vuser parameter list dialog.

This function is not recorded—you insert it manually into your script.

## Return Values

Returns 0 on success and -1 on failure.

## Parameterization

Standard parameterization is not available for this function.

## VBScript Example

In the following example, there are three parameters defined. Iteration is an Iteration Number type parameter, and Param1 and Param2 are defined in file Params.dat.The values of Param1 and Param2 are:

Param1 | Param2
--- | ---
P1_a | P2_a
P1_b | P2_b
P1_c | P2_c
P1_d | P2_d

This script shows the effect of lr.advance_param. Param1 advances at each call to lr.advance_param, and at each new iteration. With Select next row set to "sequential" in the Vuser parameter list dialog for Param2, Param2 advances only by iteration, though it is in the same file. However, with Select next row set to "Same line as Param1", Param2 advances with Param1.

Copy code

    lr.output_message "Iteration " + lr.eval_string("<Iteration>") _
            + ", Param1 " + lr.eval_string("<Param1>") _
            + ", Param2 " + lr.eval_string("<Param2>")

    lr.advance_param "Param1"

    lr.output_message "Iteration " + lr.eval_string("<Iteration>") _
            + ", Param1 " + lr.eval_string("<Param1>") _
            + ", Param2 " + lr.eval_string("<Param2>")

    Example: Output: When Select next row is set to "sequential":

    Starting iteration 1.
    Iteration 1, Param1 P1_a, Param2 P2_a
    Iteration 1, Param1 P1_b, Param2 P2_a

    Starting iteration 2.
    Iteration 2, Param1 P1_c, Param2 P2_b
    Iteration 2, Param1 P1_d, Param2 P2_b

    When Select next row is set to "Same line as Param1":

    Starting iteration 1.
    Iteration 1, Param1 P1_a, Param2 P2_a
    Iteration 1, Param1 P1_b, Param2 P2_b

    Starting iteration 2.
    Iteration 2, Param1 P1_c, Param2 P2_c
    Iteration 2, Param1 P1_d, Param2 P2_d

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: