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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sleep Producing Error

Status
Not open for further replies.

yamyam

MIS
Jul 3, 2002
19
GB
The following command is producing an error on the sleep line. This is vbscript executed from within sage Act.

do until accessapp.run("IsFinished") = "True"
wscript.sleep(1000)
loop

Please help...
 
What is the error? Why don't you ask Act? How do you know they support wsh?
 
Act supports VB script because it is shown in the examples they provide. I am trying to extend the script by calling an access function to see if the entry of an order has been completed in some bespoke software. Which is when the IsFinished function will return true. I want the program to loop until that event is true.
 
>(repeat, self) What is the error (message)?
Also, support of vbs (generally speaking) and support of "wscript.sleep" method is different thing.
 
The error message is

Object Required 'wscript'
Src: Microsoft VBScript Runtime Error
Line 14: Error 0 Scode 800a01a8
 
It is just like when you use wscript.exe internal methods is not going to be allowed in internet explorer. Hence, you cannot use it as such, period.

Having said, when you use access application run method on the command which return a value, it is doing so synchronously. Hence, by itself, the line
[tt] accessapp.run("IsFinished")[/tt]
will block the progress of the script to next line. Besides, what do you want if it return false, it would run forever conceptually.

Hence, I would suggest you simply do this and test it.
[tt]
dim bret
bret=accessapp.run("IsFinished")
if bret then
'do something as IsFinished return true
else
'do something when IsFinished return false for some reason.
end if
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top