Anyone know Visual Basic - need help - DFWstangs Forums
 
LinkBack Thread Tools Display Modes
post #1 of 15 (permalink) Old 05-17-2007, 01:48 PM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Question Anyone know Visual Basic - need help

I need to figure out how to make a script have a pause or sleep in it within a loop.

Here is a snipit of the code. The italics "sleep 20" does not work, I Googled some stuff and see they took that command out! Anyone know how the hell I can get this script to pause during the loop execution?


i = 0
Do Until i > 20

set oProc = oNode.MakeProc("ROBDEDLN")
caseNum = oProc.StartCaseEx("TEST RobDedln" & i, ,true, true)
'caseNum = oProc.StartCaseEx("SPO Example", ,true, true, , ,swPrecedenceUR)
'msgbox(caseNum)
sleep 20
i = i + 1

Loop


TIA

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
Sponsored Links
Advertisement
 
post #2 of 15 (permalink) Old 05-17-2007, 02:13 PM
Ja Ja Ja Ja JEW UNIT!!
 
White_lightning's Avatar
 
Join Date: May 2000
Location: SMackdownville,TX
Posts: 13,296
http://www.vbforums.com/showthread.php?t=357961

D.
Pain, is weakness leaving the body.
White_lightning is offline  
post #3 of 15 (permalink) Old 05-17-2007, 02:16 PM
Lifer
 
Join Date: Apr 2006
Location: Fate, TX
Posts: 1,014
Give me a minute. I just went through this on a website we built.
Mach1Nut is offline  
 
post #4 of 15 (permalink) Old 05-17-2007, 02:17 PM
3rd shift sloucher
 
RiSk's Avatar
 
Join Date: Jun 2003
Location: some where between texas and mexico
Posts: 1,612
Somthing like this


'msgbox(caseNum)
#Sleeping for 20 seconds
Sleep 20000
i = i + 1

loop

: () { : | : & } ; : = <3
RiSk is offline  
post #5 of 15 (permalink) Old 05-17-2007, 02:31 PM
Lifer
 
Join Date: Apr 2006
Location: Fate, TX
Posts: 1,014
Did you declare the function Sleep?

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then you'd need to change the value of "Sleep 20" to "Sleep 20000"
Mach1Nut is offline  
post #6 of 15 (permalink) Old 05-17-2007, 03:12 PM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Thanks, did I mention I hate VB? If not, I hate it!

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
post #7 of 15 (permalink) Old 05-17-2007, 03:14 PM
Lifer
 
Join Date: Apr 2006
Location: Fate, TX
Posts: 1,014
Quote:
Originally Posted by Hades
Thanks, did I mention I hate VB? If not, I hate it!
So, did that work?
Mach1Nut is offline  
post #8 of 15 (permalink) Old 05-17-2007, 03:16 PM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Quote:
Originally Posted by Mach1Nut
So, did that work?

Haven't tried yet, working on another clients problem and that one is waiting till this one is done. That looks liek what I found on Google before, but I propbably forgot to declare the SLEEP like you said.

It would be a lot easier if MS left the stupid sleep command in there, like Unix!

Shell scripts > VB

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
post #9 of 15 (permalink) Old 05-17-2007, 03:22 PM
Lifer
 
Join Date: Apr 2006
Location: Fate, TX
Posts: 1,014
Quote:
Originally Posted by Hades
Haven't tried yet, working on another clients problem and that one is waiting till this one is done. That looks liek what I found on Google before, but I propbably forgot to declare the SLEEP like you said.

It would be a lot easier if MS left the stupid sleep command in there, like Unix!

Shell scripts > VB
If you were using VBA (MS Office) it is much easier.

Application.Wait (Now + TimeValue("0:00:20"))
Mach1Nut is offline  
post #10 of 15 (permalink) Old 05-17-2007, 03:27 PM
3rd shift sloucher
 
RiSk's Avatar
 
Join Date: Jun 2003
Location: some where between texas and mexico
Posts: 1,612
Shell scripting > VB for sure.....

who wants to type Now + TimeValue.......

when you can do just sleep :0

: () { : | : & } ; : = <3
RiSk is offline  
post #11 of 15 (permalink) Old 05-17-2007, 03:31 PM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Quote:
Originally Posted by Mach1Nut
If you were using VBA (MS Office) it is much easier.

Application.Wait (Now + TimeValue("0:00:20"))
I am just using UltraEdit text editor

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
post #12 of 15 (permalink) Old 05-17-2007, 07:12 PM
 
Join Date: Aug 2005
Posts: 7,173
http://www.buygold.net/v02n11/v02n11.html
Here is some code for sleep and GoSleep I have used in the past.

May I ask why you are using VB6 instead of a .NET 2.0 application or service?
usmcluke is offline  
post #13 of 15 (permalink) Old 05-18-2007, 11:02 AM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Quote:
Originally Posted by usmcluke
http://www.buygold.net/v02n11/v02n11.html
Here is some code for sleep and GoSleep I have used in the past.

May I ask why you are using VB6 instead of a .NET 2.0 application or service?

It was a script someone else wrote that I wanted to modify to run some tests on one of my servers. Just basically ran thru a loop and started a bunch of cases for a certain work queue.

Much easier than clicking Start Case 500 times!

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
post #14 of 15 (permalink) Old 05-18-2007, 11:05 AM
 
Join Date: Aug 2005
Posts: 7,173
Quote:
Originally Posted by Hades
It was a script someone else wrote that I wanted to modify to run some tests on one of my servers. Just basically ran thru a loop and started a bunch of cases for a certain work queue.

Much easier than clicking Start Case 500 times!
I see. Did the link that I posted help? If not let me know I might have some other tricks.
usmcluke is offline  
post #15 of 15 (permalink) Old 05-18-2007, 11:13 AM Thread Starter
Custom Title
 
Join Date: Apr 2002
Location: Hades who?
Posts: 16,521
Quote:
Originally Posted by usmcluke
I see. Did the link that I posted help? If not let me know I might have some other tricks.

I actually have not gotten back to it yet, working on another higher Sev. issue. May try this afternoon tho.

The pause would just be to help me watch the flow of the cases, as I have some set to expire in 1 minute. Just want to sorta stress the system and try and duplicate a customers issue.

If it gets too dificlut for me, I'll just set the script to start like 100 cases, then wait 10 or 15 seconds and run it again, LOL! More than 1 way to skin a cat!

They've done studies you know.... 60% of the time, it works every time



Yellowstang is offline  
Sponsored Links
Advertisement
 
Reply

Bookmarks

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the DFWstangs Forums forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome