hello,
Thanks for the reply!!!
I am currently facing an issue while executing an application wherein I'm encountering the error "Variable is undefined: 'WScript'" when attempting to use the "WScript.Sleep 500" command. As a result, I am seeking assistance to identify any alternative keywords or methods that can be used in place of "WScript.Sleep 500".
WScript.Sleep alternatives?
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: WScript.Sleep alternatives?
Hello Mohanraj,
Please open a new topic if you have a new question so other people can find
answers as well.
I created a new topic this time
You can use Wait Method of the PE6 Application object:
Here a passage from the PCAN-Explorer 6 help:
Applies to: Application object
Waits for the given number of milliseconds.
Syntax
object.Wait ( Time )
Parameters:
object
An expression that evaluates to an Application object. When you use the Wait method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.
Time
A Long value, indicating the number of milliseconds, which to wait for.
Remarks
The Wait method serves VBScript Macros for waiting a defined time. VBScript does not have a predefined function for this task.
Example
The following example waits until the transmit message queue of a PCAN client is empty.
VBS Macro
Best Regards
Marvin
Please open a new topic if you have a new question so other people can find
answers as well.
I created a new topic this time

You can use Wait Method of the PE6 Application object:
Here a passage from the PCAN-Explorer 6 help:
Applies to: Application object
Waits for the given number of milliseconds.
Syntax
object.Wait ( Time )
Parameters:
object
An expression that evaluates to an Application object. When you use the Wait method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.
Time
A Long value, indicating the number of milliseconds, which to wait for.
Remarks
The Wait method serves VBScript Macros for waiting a defined time. VBScript does not have a predefined function for this task.
Example
The following example waits until the transmit message queue of a PCAN client is empty.
VBS Macro
Code: Select all
While Not myClient.XmtQueueEmpty
Wait 500
Wend
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team