SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3

Thread: Array sizes

  1. #1
    Member
    Join Date
    Apr 2002
    Location
    Bicester, Oxfordshire, England
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Array sizes

    Can anyone tell me if there is a WinRunner function that will tell me the size of an array.
    In QA-Run I can use the ArraySize(XYZ) function, but it's been 2 years since I last used WinRunner, and...
    Thanks

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

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Location
    Irvine, CA 92606 USA
    Posts
    384
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Array sizes

    This is one of the many things I miss about Visual Test.

    This will work but you need to remember several things about WR.

    An Array can have elements such as listed below:
    public arrayX[];
    arrayX[5] = "a";
    arrayX[15] = "b";

    arraxX only has Two elements [5] and [15]
    there contents are "a" and "b". Using the code below, arrayX "num_of_elements" will equal 2. You know there are Two elements, you just don't know which Two.

    The code below will count the number of elements in an Array. String xxx will contain the elements. The order theelements is obtained by the "in" operator is unkown. See on-line help for "in".

    # ==============================
    public Array1[] = {"1","2","3","4","5"};
    static num_of_elements = 0;
    static element = 0;
    static xxx = "";

    for ( element in Array1 )
    {
    num_of_elements++;
    xxx = xxx&element&",";
    }
    # ==============================


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

  3. #3
    Moderator
    Join Date
    Apr 2001
    Location
    Atlanta, GA, USA
    Posts
    2,167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Array sizes

    The easy way:

    Go to the MI Support site.
    Go to downloads section
    Get the Array functions (Dated 15 Sept 2000 and 13 Nov 2000) by Ferry Firmansjah. Those should give you what you need.

    ------------------
    WinAmp. Llama Tested. Mother Approved.
    Jordan Gottlieb - Keeper of the QA Forums FAQ
    Qualitech Solutions, Inc.
    jgottlieb@qualitechsolutions.com
    Jordan Gottlieb
    Senior Consultant, Orasi Software
    Twitter: @JG_QA

 

 

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 01:35 AM.

Copyright BetaSoft Inc.