SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Getting all the edit box values and List box values !!!

    User (idhrees@yahoo.com.nospam) posted:

    Hi all,
    I like to get all the edit box values and List box values
    from a screen. I am using the following code, but it retrieves only
    the Edit box values and throws error with list boxes. Could some one
    help me out.
     Assume the window contain 16 edit boxes and 9 list boxes

    It's just a repeat of my previous mail..but with a subject..

    static old_data[];

    public function _Get_Values(inout data[])
    {
    auto i,j,rc,myedit,mylist,number;
    delete data[];

    set_window(window_nanme, 5);
    for(i= 0;i<=15;i++){
    if(edit_get_info("{class: edit, index: " & i
    & "}","value",data[i]) != 0)return(1);
    print("E "&data[i]);
    }

    j = i+1;
    for(i= 0;i<=8;i++){
    if(list_get_selected("{class: list, index: " & i
    & "}",data[j],number) != 0)return(1);
    print("L "&data[j]);
    }
    return(0);
    }
    Get_Values(old_data);


    Is there any other way to get the values of all the controls from a
    screen at run time. Responses are highly appreciated
    Thanx
    Idhrees

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Posts
    216
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Getting all the edit box values and List box values !!!

    User misha (mm_ke@yahoo.com.nospam) posted:

    Hi Idhrees

    Currently your function errors and then returns when it runs out of edit
    boxes.
    I would suggest using obj_exists() to check for the edit box before getting
    the value, eg.

    if(obj_exists("{class: edit, index: " i "}",-1) != E_OK) break;

    Then when you run out of edit boxes the function will drop through to do the
    list boxes.
    You can do the same thing for the list boxes.
    Then with a bit of fixing up of your variables, eg. data[j+i] for lists,
    your function will work ok.

    Cheers,
    Misha
    ----- Original Message -----
    From: <idhrees@yahoo.com>
    To: <winrunner@yahoogroups.com>
    Sent: Saturday, November 03, 2001 3:11 AM
    Subject: [winrunner] Getting all the edit box values and List box values !!!


    Hi all,
    I like to get all the edit box values and List box values
    from a screen. I am using the following code, but it retrieves only
    the Edit box values and throws error with list boxes. Could some one
    help me out.
     Assume the window contain 16 edit boxes and 9 list boxes

    static old_data[];

    public function _Get_Values(inout data[])
    {
    auto i,j,rc,myedit,mylist,number;
    delete data[];

    set_window(window_nanme, 5);
    for(i= 0;i<=15;i++){
    if(edit_get_info("{class: edit, index: " & i
    & "}","value",data[i]) != 0)return(1);
    print("E "&data[i]);
    }

    j = i+1;
    for(i= 0;i<=8;i++){
    if(list_get_selected("{class: list, index: " & i
    & "}",data[j],number) != 0)return(1);
    print("L "&data[j]);
    }
    return(0);
    }
    Get_Values(old_data);


    Is there any other way to get the values of all the controls from a
    screen at run time. Responses are highly appreciated
    Thanx
    Idhrees

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Getting all the edit box values and List box values !!!

    User (vdubbin_69@yahoo.com.nospam) posted:

    The following snippet of code doesn't need to know how many edit or
    list boxes are on a screen.

    for (i in allObjs) delete allObjs[i];
    objCnt = 0;
    for (i = 0; ; i++)
    {
    obj = sprintf ("{class: edit, index: %d}", i);

    # Use _edit_get_text to avoid getting WR error.
    # Not sure if "value" and "text" the same for
    # you when you use edit_get_info.
    if ((rc = _edit_get_text (obj, val)) != E_OK)
    break;

    objCnt++;
    allObjs[objCnt] = val;
    printf ("E %s", val);
    }

    for (i = 0; ; i++)
    {
    obj = sprintf ("{class: list, index: %d}", i);

    # Use _list_get_selected to avoid getting WR error
    if ((rc = _list_get_selected (obj, val, num)) != E_OK)
    break;

    objCnt++;
    allObjs[objCnt] = val;
    printf ("L %s", val);
    }

    --- In winrunner@y..., idhrees@y... wrote:
    one



  4. #4
    Junior Member
    Join Date
    Oct 2001
    Location
    India
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Getting all the edit box values and List box values !!!

    Misha and vdubbin thanx for the effort, let me try ur suggestions....

    Regards,
    Idhrees

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

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Location
    India
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Getting all the edit box values and List box values !!!

    Vdubbin...your code works well...
    thanx for ur effort,
    Idhrees

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

  6. #6
    Points for Confirmed Friends
    Guest

    Re: Getting all the edit box values and List box values !!!

    nice coding. well done guys.

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

 

 

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.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:21 PM.

Copyright BetaSoft Inc.