Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I break out of Do Loop after 10 minutes?

Status
Not open for further replies.

lhailey

Programmer
Sep 24, 2010
4
US
Hi, I need help breaking out of a loop after x number of minutes. The following script loops every 5 seconds until txtout = txtin. The script loops indefinitely if txtout does not equal txtin.

How do I break out of the loop after 10 minutes?


'Loop start

Do
txtout = JavaWindow("HorizON").JavaTable("BaseTable").GetCellData(0, "Text")
txtin = DataTable("Txt_Input", dtLocalSheet)
datatable ("Txt_Output", dtLocalSheet) = txtout

If txtout = txtin Then
wait 5
Exit Do
End If
Loop

msgbox "Text Input: " & txtin & vbcr & "EQUALS" & vbcr & "Text Ouptut: " & txtout

 
>How do I break out of the loop after 10 minutes?
Something like this.
[tt]
[blue]dim ti
ti=timer[/blue]
Do
'etc...
Loop [blue]while (timer-ti)<10*60 '10*60 seconds[/blue]
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top