Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 28th, 2007, 05:38 PM
iglobal iglobal is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 8 iglobal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 10 m 41 sec
Reputation Power: 0
How do I pause this loop

I need to pause my loop for a few seconds, but have not been succesful. I have tried the timer control, but i guess i'm implementing it wrongly. Basiclly, I want to loop to go in this manner:

Step 1 => Login
Step 2 => Load Page 2
Step 3 => LogOut
Step 4 => Pause for a few user seconds before login in again

The Sub below works except for the pause part. Does anyone have any suggestions?

Thank you

Code:
Private Sub submitAll()

' Login

Dim X As Integer
For X = LBound(myUsernames) To UBound(myUsernames)
If myUsernames(X) <> "" Then

username = myUsernames(X)
password = myPasswords(X)


' Login

lblStatus.Caption = "Submiting as Username: " & username & " Password: " & password
loginURL = "aaa"
Web.Navigate (loginURL)
While (Web.ReadyState <> READYSTATE_COMPLETE)
     DoEvents
Wend


' Load Page 2

myURL = URLEncode(txtURL.Text)
myTags = URLEncode(txtTags.Text)
Web.Navigate (myURL)
While (Web.ReadyState <> READYSTATE_COMPLETE)
     DoEvents
Wend


' LogOut Account

Web.Navigate ("XXX")
While (Web.ReadyState <> READYSTATE_COMPLETE)
     DoEvents
Wend
End If


Next X

End Sub

Confused Coder,

Ash

Reply With Quote
  #2  
Old January 29th, 2007, 08:16 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
you can use the API function.
add this declaration to your code:
Code:
private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (byval dwMilliseconds as Long)

then when you wish to pause:
Code:
While (Web.ReadyState <> READYSTATE_COMPLETE)
     Sleep(200)
     DoEvents
Wend

this will pause for 200 miliseconds each iteration.
(information was taken from this external forum: http://www.codeguru.com/forum/archi...hp/t-21522.html)

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > How do I pause this loop


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT