SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Oct 2002
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    use of LAST in variable parameter count functions

    Does this constant always need to be sent as the final parameter ONLY? Or can it be conditionally placed in the middle of a parameter list in order to effectively send a variable number of parameters to built in LR functions?

    ------------------

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Location
    Pune, Maharashtra, India
    Posts
    1,037
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: use of LAST in variable parameter count functions

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Does this constant always need to be sent as the final parameter ONLY?<HR></BLOCKQUOTE>

    Perhaps constant is inconsistent with the nature of LAST. I would term
    it a string token.
    The as_web.h defines it as:
    #define LAST "LAST"

    So it is a token used by LoadRunner's functions internally to mark the last of the Name-Value pairs that are streamed into it. My prelimnary experiments with using LAST in the middle of a bunch of Name-Value pairs seems to indicate that the N-V pairs following LAST are ignored/left unprocessed.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Or can it be conditionally placed in the middle of a parameter list in order to effectively send a variable number of parameters to built in LR functions?<HR></BLOCKQUOTE>

    It seems you have indeed struck the jackpot this time with this idea! It might be possible to do something like this:


    //Pointer array
    char *szWebSubmitDataBuffer[MAXPARAMS];

    // Get how many params to send
    web_reg_save_param("HowManyParamsToSend", ...);
    web_url("PageThatGivesThatNumber",...);

    // Fill in neccessary information
    strcpy(szWebSubmitDataBuffer[0], "SomeName");
    strcpy(szWebSubmitDataBuffer[1], "Action=http://{BaseURL}/App/Whatever.Servlet");
    strcpy(szWebSubmitDataBuffer[2], "Method=POST");
    strcpy(szWebSubmitDataBuffer[3], "TargetFrame=");
    strcpy(szWebSubmitDataBuffer[4], "RecContentType=text/html");
    strcpy(szWebSubmitDataBuffer[5], "Referer=http://{BaseURL}/App/Ref.jsp");
    strcpy(szWebSubmitDataBuffer[6], "Snapshot=t99.inf");
    strcpy(szWebSubmitDataBuffer[7], "Mode=HTML");
    strcpy(szWebSubmitDataBuffer[8], "ITEMDATA");

    // Start the For loop
    for(i = 0; i &lt; MAXPARAMS; (i=i+3))
    {
    // Populating n-v pair in temp buffers
    sprintf(szName. "Name=Field%d", i);
    sprintf(szValue, "Value=%d", i);

    // The first 9 places in the buffer are taken - see above
    strcpy(szWebSubmitDataBuffer[i+9], szName);
    strcpy(szWebSubmitDataBuffer[i+10], szValue);
    strcpy(szWebSubmitDataBuffer[i+11], "ENDITEM");

    // We want to stop here
    if( atoi(lr_eval_string("{HowManyParamsToSend}")) == i)
    {
    strcpy(szWebSubmitDataBuffer[i+12], "LAST");
    i=i+1;
    }

    }

    // The mega-submit
    web_submit_data(szWebSubmitDataBuffer);

    ------------------
    -Suresh Nageswaran, CQA, CSTE
    punekar@yahoo.com
    Cognizant Technology Solutions,
    Pune, India.
    Suresh Nageswaran, CQA, CSTE
    Lead Consultant
    Kanbay Inc.
    Pune, India.
    sureshnageswaran@yahoo.com

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:31 PM.

Copyright BetaSoft Inc.