lr.paramIncrement

Increments the value of a numerical parameter.

ExampleRuntime Functions

Syntax

lr.paramIncrement( destinationParam, sourceParam ); 

Arguments

ArgumentComments
destinationParamThe name of the parameter to store the incremented parameter
sourceParamThe name of the parameter whose value is incremented

The lr.paramIncrement function retrieves the value of sourceParam, increments its value by one, and stores the incremented value as a null terminated string in destinationParam.

sourceParam must be initialized with an integer value prior to calling lr.paramIncrement. sourceParam's value should include only single-byte digit characters with an optional sign or leading zeros.

When destinationParam exists, its value is overwritten. When it doesn't exist, the parameter is created dynamically.

The value of sourceParam is restricted to the maximum value of a long integer minus 1.

Return Values

This function returns the following values:

ConstantValueResult
LR_PARAM_INC_OK 0Success
LR_PARAM_INC_ERR_SAVE_FAILED-1The save operation to the destination parameter failed.
LR_PARAM_INC_ERR_MBCS_IN_SRC-2The source parameter includes multibyte characters, which indicates that it is not a pure numeric parameter.
LR_PARAM_INC_ERR_SRC_NOT_NUM-3The source parameter includes singlebyte characters that are not digits, or the source parameter does not exist.
LR_PARAM_INC_ERR_EVAL_FAILED-4The evaluation operation of the source parameter failed.

Parameterization

Standard parameterization is not available for this function.

Example

lr.paramIncrement("result", "{Iteration}");
lr.outputMessage(lr.evalString("{result}"));