LoadRunner Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

LoadRunner 11.52 Function reference code issues

SOLVED
Go to Solution
Frequent Advisor

LoadRunner 11.52 Function reference code issues

I am sure this is something I am doing incorrectly, but when I copy and paste the following from the function reference into my action I am getting the following errors:

 

 

 

 

Do I need an extra include statment or something?

4 REPLIES
Esteemed Contributor

Re: LoadRunner 11.52 Function reference code issues

[ Edited ]

Hi KF1,

 

I do not have Vugen 11.52, but when I ran the same code from Vugen 11 Patch 4 it worked fine.

 

 

May be you have to delete the blank lines which are present in your code.

 

Make sure you copy the code in the Action section.

 

Action()

{

.....................

.......Our Code.

......................

}

 

Regards,

Srihari 

Frequent Advisor

Re: LoadRunner 11.52 Function reference code issues

Thanks so much for your reply.  I took a better screenshot.  I cant figure out what is wrong.  It makes no sense to me.  Does anyone know why this isnt working?  Is it a bug?

 

 

The red box has errors, the green box is my modified(bad practice) code that works.

 

Acclaimed Contributor Acclaimed Contributor

Re: LoadRunner 11.52 Function reference code issues

>Does anyone know why this isn't working?

 

If this is C89, you can't have declarations in the middle of a block.  You need C++ or C99 to do that.

(That's why it worked for Srihari_Amgen.)

 So move that "char *ip;" up.

 

Note: If not modifying "ip", you should declare it "const char*".

Frequent Advisor

Re: LoadRunner 11.52 Function reference code issues

Excellent thanks for the help.  I was able to get it working by moving the declaration right above the Action.