docs

Home All functions Categories

vuRunDelay(pFile, DelayMS)

vuRunDelay(*CSTRING pFile, LONG DelayMS), LONG

Description

Runs the specified file after waiting for a specified delay.

Parameters

Parameter Data Type Description
pFile CSTRING(260) Full path to the file to execute.
DelayMS LONG Delay before execution, in milliseconds (e.g., 2000 = 2 seconds).

Note: In vuFileTools V5, CSTRINGs are not limited to the size shown above. The number is for example only.

Returns

A LONG value indicating the result:

Example

FilePath CSTRING(260)
DelayMS  LONG
Ret      LONG

FilePath = 'C:\Windows\notepad.exe'
DelayMS  = 2000   ! 2 seconds

Ret = vuRunDelay(FilePath, DelayMS)

MESSAGE('vuRunDelay returned: ' & FORMAT(Ret), 'vuRunDelay Test')

Notes

Useful for delaying startup of another process to allow system resources or dependencies to initialize.

If the file does not exist, the function returns 0 and does not attempt to run.

Home All functions Categories