SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    preserving the contents of an array

    How can I preserve the contents of array. I need to append the data to the existing rather than overwrite the array contents.

  2. #2
    Senior Member
    Join Date
    Oct 2001
    Location
    Nashville, TN, USA
    Posts
    713
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: preserving the contents of an array

    If you need to change the size of the array without loosing the contents, use 'Redim Preserve'. Otherwise, just make sure you use an index in the array that has not already been used.
    Boyd Patterson
    Patterson Consulting, LLC
    www.patterson-consulting.net

    [i]Creator of Test Design Studio - Powerful IDE for QuickTest Pro[i]

  3. #3
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: preserving the contents of an array

    Do while Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Object.nameProp = "pagenext.gif"
    'If Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Object.disabled Then Exit Do
    'print Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Object.disabled
    Set objTable = Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").WebTable("Fund")
    intRowCount = objTable.RowCount
    intFirstDataRow = 2
    intCol17 = 17
    'svalues = ""


    For intRow = intFirstDataRow to intRowCount
    ReDim Preserve arrCol17(intRow -2)
    arrCol17(intRow-2) = objTable.GetCellData(intRow, intCol17)

    Next



    Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Click
    Loop

    For Each x in arrCol17
    print x
    Next

    This is my test script. The webpage displays only 30 rows each time. I need to click on the next button to view the remaining rows. I need to keep doing till the next button is disabled after I retireve all the rows from that column I need to check if it sorted. But the problem when I print the loop outside the do while I can just see the rows of the last page in the array. How can I view the contents of the entire array?

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: preserving the contents of an array

    It is an issue with your logic. Here follow this approach

    ReDim arrCol17(-1)

    START LOOP

    ReDim Preserve arrCol17(UBOUND(arrCol17) + 1)
    arrCol17(UBOUND(arrCol17)) = objTable.GetCellData(intRow, intCol17)

    END LOOP

    This way you will never loose rows

 

 

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 09:43 PM.

Copyright BetaSoft Inc.