WScript.Sleep alternatives?

Professional Windows® software to communicate with CAN and CAN FD busses and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
mohanraj
Posts: 5
Joined: Tue 23. Apr 2024, 07:09

WScript.Sleep alternatives?

Post by mohanraj » Wed 24. Apr 2024, 14:14

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".

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: WScript.Sleep alternatives?

Post by M.Heidemann » Wed 24. Apr 2024, 14:31

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

Code: Select all

While Not myClient.XmtQueueEmpty

   Wait 500

Wend
Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply