LoadRunner sprintf and lr_eval_string


I am facing some issues that I'm certain is correct code, as I've seen it work before today, and without any changes made to the script, only a VUGen version change/upgrade.

HP Virtual User Generator:: Version:

ClockingIDCount = atoi(lr_eval_string("{ClockingID_count}"));


for (i = 1; i <= ClockingIDCount; i++) {
    sprintf(loopParam, "{ClockingID_%d}", i);
    lr_output_message("ClockingID: %s %s %s", loopParam, lr_eval_string("{loopParam}"), lr_eval_string(lr_eval_string("{loopParam}")));


Action.c(120): CIDCount:21
Action.c(121): Notify: Parameter Substitution: parameter "ClockingID_1" =  "6829888"
Action.c(121): ClockingID1::6829888

But using the sprintf function to iterate over the items captured, returns;

Action.c(125): ClockingID: {ClockingID_1} {loopParam} {loopParam}

Note: I'm aware the 3rd %s evaluation shouldn't work – was just a thought as I've seen it resolve things like this before.

Best Solution

Code tampered!

Solution :: Remove the "{ }" from the lr_eval_string function;

Solution :: lr_output_message("ClockingID: %s", lr_eval_string(loopParam));