Advertisement

08.19.2004 at 07:42AM PDT, ID: 21099829
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

how to make a vbscript sleep w/o pinning the cpu

Asked by tomandlis in Active Server Pages (ASP)

Tags: ,

I am trying to make a client-side vbscript sleep but can't do it w/o pinning the cpu

The Code is below, pretty straight forward, but I get the following error:

error: object doesn't support this property or method 'Wscript.Sleep'

***********code
<html>
<head>
<SCRIPT LANGUAGE="vbscript" >
      function bSleep()
            document.All.whatsup.innerHTML = "I'm sleepy"
            Set WScript = CreateObject("WScript.Shell")
            WScript.Sleep 2000
            document.All.whatsup.innerHTML = "Done sleeping"
      end function
</script>
<body onload="call bSleep()">
<div id="whatsup"></div>
</body>
</html>

***********end code

To workaround, I swap out the wscript.sleep and use a loop, but it pins the cpu and that isn't acceptable because I am sleeping so other stuff can happen in the background.  Here is the loop code that pins the cpu:

***********code  snip (loop1)

StartTime=Now()
Do While Now() < StartTime + 8.0 / (3600.0 * 24.0)
      '      loop
Loop

***********end code snip

I also tried this loop:

***********code  snip (loop2)

Do While Not oBrowser.readyState = READYSTATE_COMPLETE
'      sometimes this fails--failure is unacceptable
Loop

***********end code snip

FYI, You're probably wondering how the oBrowser object got involved in loop2 (above).  If you want some background on the context. . . I am using this sleep code while a internetexplorer object navigates.  I've found that looping structure #2 doesn't work when a site is a slow loader, i.e., it will say the readystate is complete, but it really isn't!  Additionally, loop2 pins the cpu too and the spawned browser can't download anything.

Below is the complete code for my application if you want to put it all in context run this code below.  For this to work you have to set your ie default tools-options-security-default level to 'low'

***********all code

<html>
<head>
<SCRIPT LANGUAGE="vbscript" >
      function bUpdateAll()
            document.All.whatsup.innerHTML = "starting"
            sUrl = "http://www.aspfree.com"

            const READYSTATE_COMPLETE = 4
            on error resume next

            Set oBrowser = CreateObject("InternetExplorer.Application")

            if err.number <> 0 then            
                  document.All.whatsup.innerHTML = "set your ie default tools-options-security-default level to 'low'"
                  exit function
            end if

            on error goto 0

            oBrowser.Width = 600
            oBrowser.Height = 400
            oBrowser.Left = 50
            oBrowser.Top = 50
            oBrowser.Visible = true      
            oBrowser.Silent = true

            oBrowser.Navigate(sUrl)
            StartTime=Now()
            Do While Not oBrowser.readyState = READYSTATE_COMPLETE
                  '      loop
            Loop
            set oBrowser = nothing
            document.All.whatsup.innerHTML = "done"
      end function
</script>
</head>
<body onload="call bUpdateAll()">
      <div id="whatsup"></div>
</body>
</html>

***********end all code
Start Free Trial
[+][-]08.19.2004 at 07:53AM PDT, ID: 11842000

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 07:58AM PDT, ID: 11842058

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 08:21AM PDT, ID: 11842375

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 08:47AM PDT, ID: 11842655

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:07AM PDT, ID: 11842873

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:10AM PDT, ID: 11842912

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:14AM PDT, ID: 11842951

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:14AM PDT, ID: 11842964

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:31AM PDT, ID: 11843147

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 09:52AM PDT, ID: 11843425

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 10:14AM PDT, ID: 11843707

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 10:18AM PDT, ID: 11843761

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 10:24AM PDT, ID: 11843832

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 10:26AM PDT, ID: 11843858

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 11:05AM PDT, ID: 11844368

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: sleep, vbscript
Sign Up Now!
Solution Provided By: BChan
Participating Experts: 5
Solution Grade: A
 
 
[+][-]08.19.2004 at 11:09AM PDT, ID: 11844437

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 11:39AM PDT, ID: 11844805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 12:15PM PDT, ID: 11845179

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 12:19PM PDT, ID: 11845210

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 12:44PM PDT, ID: 11845485

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2004 at 12:50PM PDT, ID: 11845551

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy