SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    multipe for loops

    I am trying to verify data in multiple field on a screen. But the 1st FOR statement is not moving to the send value in the array. What am I missing?

    Dim Sort_By
    Dim Type_By
    Dim a
    Dim i

    Sort_By = Array("Margin Pct", "Product Code Descr")
    Type_By = Array("Margin_Pct", "Product_Code_Descr")

    For i = LBound(Sort_By) To UBound(Sort_By)
    For a = LBound(Type_By) To UBound(Type_By)
    Window("Product Code Master").WinButton("Update").Click
    test2 = Window("Product Code Master").WinEdit(Sort_By(i)).GetROProperty("Text")

    msgbox(Sort_By(i))
    Window("Product Code Master").WinEdit(Sort_By(i)).Set datatable (Type_By(a), dtglobalsheet)
    wait(1)

    Window("Product Code Master").WinButton("Reset").Click
    wait(1)
    Window("Product Code Master").WinButton("Cancel").Click
    test3 = Window("Product Code Master").WinEdit(Sort_By(i)).GetROProperty("Text")

    counter = Counter + 1
    msgbox(test2)
    msgbox(test3)
    Next
    Next

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    300
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multipe for loops

    I didnt see any problem with the loop, check this..

    Sort_By = Array("Margin Pct", "Product Code Descr")
    Type_By = Array("Margin_Pct", "Product_Code_Descr")

    For i = LBound(Sort_By) To UBound(Sort_By)
    For a = LBound(Type_By) To UBound(Type_By)
    msgbox Sort_By(i)



    Next
    Next


    its being executed for 4 times.

    What you are looking for?

    Thanks,
    Ashok

  3. #3
    Member
    Join Date
    Apr 2008
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multipe for loops

    I expected it to run 2 iterations of the code. Once for Margin Pct and once for Product Code Descr. The 1st array is selecting the field and the 2nd array is entering data from the datatable. I see what you are saying in your comment. Where am I messing up then?

 

 

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 10:11 AM.

Copyright BetaSoft Inc.