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 2010
    Posts
    94
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to move next in For Next Loop based on conditi

    Hello Experts,

    I'm getting data input for my scripts though an excel sheet. This sheet will going to have many rows so I'm doing the execution in For Next loop. Now here is the problem I'm facing and need help from you people.

    Let say I'm navigating to a particular URL whose value I'm getting from specific cell. This cell may or may not be empty (based on the results of another scripts results execution) I'don't now know to tell my For Next loop that if there is not value in the cell then move down to next row and look value there.

    I've written a logic to exist because based on business rule if 2 consective cell are empty them quite execution.

    For reference here is my code.
    '================================================= ========
    For x = 1 to NumRows
    If DataTable.GetSheet(4).GetParameter("CustomerSegmen tationObject").ValueByRow(x) = Empty Then
    'check next 2 cell values
    If DataTable.GetSheet(4).GetParameter("CustomerSegmen tationObject").ValueByRow(x+1) = Empty And _
    DataTable.GetSheet(4).GetParameter("CustomerSegmen tationObject").ValueByRow(x+2) = Empty Then
    Exit For
    End If
    Else
    'MAKE INCREMENT TO GO TO NEXT VALUE IN LOOP AND PERFORM REQUIRED STEPS

    Browser("Customer Segmentation:").Navigate DataTable.GetSheet(4).GetParameter("CustomerSegmen tationObject").ValueByRow(x)

    Browser("Customer Segmentation:").Page("Customer Segmentation:").WebButton("Button-Clone").Click


    Next
    '================================================= ========

    Can somebody show me how to make increment to For Next and in this situation.

    Many Thanks in advance.

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to move next in For Next Loop based on conditi

    DataTable.GetSheet(4).SetCurrentRow(x)

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

    Re: How to move next in For Next Loop based on conditi

    Nevermind guys I got it.

  4. #4
    Senior Member
    Join Date
    Mar 2009
    Posts
    184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to move next in For Next Loop based on conditi

    So post how you fixed it!

    Peace!

 

 

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.71%
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:31 AM.

Copyright BetaSoft Inc.