Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to skip a For count?
#1
Not Solved
How do i code this For statement thus to skip to the Next for if a "No" flag is encountered?

Code:
For intRow=1 to intRowCount
    DataTable.GetSheet(intSheetDetails).SetCurrentRow(intRow)     

    Flag = "NO"

     Flag=ucase(DataTable("Flag","Details"))

         If  Flag = "YES" Then
                QC_Path=trim(DataTable("QC_Path","Details"))
                TestSetName=trim(DataTable("TestSetName","Details"))    
        Else
                GO TO NEXT ITERATION IN "FOR" STATEMENT
        End If
...
...
...
...
Next
Reply
#2
Not Solved
You don't need to use an Else, IF the condition of Yes is satisfied, it will get into the IF Then loop, else it will automatically move to the next iteration as For Loop has a Next statement.

Code:
For i = 0 to 10
  If i=5 then
    msgbox "val is 5"
end if
msgbox i
Next

Only on the value 5 it will get pop the msgbox. Otherwise, it will move on to the next values.
Hopefully this is what you were looking for, If not please elaborate on the issue.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
basanth27

The problem is, that the code ... (after the End If) will always be run. If a No is encountered, I need to go to the Next count. Maybe I need to stick all of my code (70 lines) inside the If statrement?

Thx for your help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help for instruction to click on Skip button in the warning message vijilesh 0 1,556 09-16-2018, 03:48 PM
Last Post: vijilesh
  How to skip an action newqtp 2 5,882 02-13-2013, 03:31 AM
Last Post: newqtp
  Skip button using Script manishnangalia 10 8,341 08-01-2012, 07:29 PM
Last Post: Ankesh
  Press the Skip button on the dialog box mv8167 3 3,283 12-06-2011, 12:24 PM
Last Post: prasant
  How to skip the execution of Script lines in run time azeem 5 12,082 02-01-2010, 03:14 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)