SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Oct 2004
    Location
    Bangalore
    Posts
    270
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Sorting in Array

    Hi,

    how to check is array sorted, means, want to find wether all the elements of arrays is in sort order or not.
    i know the code like.....in For Loop iterate thr' all the elements and compare the element with its next element....
    but i am looking for any built in function where in one shot i can get whether the elements of an array is sorted or not.

    Cheers
    Yogi

  2. #2
    Advanced Member
    Join Date
    Apr 2005
    Location
    Maryland
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sorting in Array

    Hope this help's:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">'Sort String Array
    Public Sub SortStringArray(ByRef strList$())
    lo = 1
    hi = UBound(strList)
    While hi &gt; lo
    max = lo
    For p = lo+1 To hi
    If StrComp(strList(p), strList(max), 1) &gt; 0 Then
    max = p
    End If
    Next
    'swap max with hi
    temp = strList(max)
    strList(max) = strList(hi)
    strList(hi) = temp
    hi = hi - 1
    Wend
    End Sub</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    Alfredo R. Rivera
    IT Principal SDLC Automation Subject Matter Expert
    (CCRC/CQ/CQTM/RMT/RFT/RPT/REQPRO)
    (LR/QTP/CQ/SS/WR)
    Certified Mercury Interactive Instructor
    Certified Tester, Foundation Level (CTFL)
    www.fredotech.com
    www.testingframework.com
    www.automationtesting.org
    http://www.linkedin.com/in/fredotech

  3. #3
    Senior Member
    Join Date
    Oct 2004
    Location
    Bangalore
    Posts
    270
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sorting in Array

    Hi,
    here also we should iterate thr' all the elements i am searching for something built in function, no need of writing the code manually some thing like isArraySorted ???

    Yogi

  4. #4
    Junior Member
    Join Date
    Aug 2005
    Location
    Bangalore
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sorting in Array

    Yogi,

    I dont think so that you will get a buil-in function for this.
    Because the question will be, sorting in which order? What is the datatype of array elements?


    Cheers
    Rohith Shetty

  5. #5
    Junior Member
    Join Date
    Apr 2006
    Location
    USA
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sorting in Array

    yo_kalps@yahoo.com <ul type="square"> I am working on QTP. I have priority list displaying stars. The highest priority record displays 5 stars.The next displays 4 stars.
    How to verify the records are in sorted order.[/list]
    Kalpana

  6. #6
    Senior Member
    Join Date
    Feb 2003
    Location
    FL, USA
    Posts
    3,646
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Sorting in Array

    Moderator - this is a duplicate question of post

    http://www.sqaforums.com/showflat.php?Ca...true#Post326472
    Lynne

    I have not failed. I've just found 10,000 ways that won't work" --Thomas Edison

 

 

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 10.00%
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 02:43 AM.

Copyright BetaSoft Inc.