Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual 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 Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 19th, 2003, 02:27 PM
kvijai kvijai is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 kvijai User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Urgent: WScript Help

Hello,
I am pretty new to VBScript and WScript and I am having a major problem that I need to fix before a demo tomorrow. It might just be something simple that I am doing wrong. Any help is greatly appreciated.

My project is basically a web based video player and it has a play subroutine and a stop subroutine. I have a while loop in my play sub. that keeps running til the end of the video. Inside this while loop I use the sleep method of Wscript to slow down the loop since I only need info. from the loop every 2 seconds or so.

The problem is I cannot seem to quit the WScript. When the user clicks on the stop button the stop sub is called and I call WScript.Quit in my stop sub. But I get an error message saying "Object required" at that line.

Here is a part of the code I am working on:

dim WshShell
dim breakOut

sub play
set WshShell = CreateObject("WScript.Shell")
while(breakOut = 0)
Call WshShell.Run("C:\sleep.vbs", ,true)
wend
end sub

sub stop
WScript.Quit
end sub

The sleep.vbs file just has one line in it:
WScript.sleep 500

Please let me know if you know why WScript won't quit. Without it quitting I can't close IE.

Thank you for your time and help.

Vijai

Reply With Quote
  #2  
Old August 20th, 2003, 08:34 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Try WScript.Quit 1

Depending on your version of windows that you are running, you probably have a wscript help manual on your machine. Search for WSH.CHM which is the compiled help manual.

Also, your subject title in unacceptable. You can refer to the sticky thread at the top of this forum for more information on how to post a question.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Urgent: WScript Help


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway