Home > Language Reference > System Variables > ActionTimeout

#ActionTimeout

The #ActionTimeout system variable specifies the number of seconds which WinTask should wait before reporting an execution error when a statement within a script fails.

Usage

Used to increase the delay before an execution error is reported. For example, a script downloads a file and this download takes around 45 seconds. The script waits until the download has completed by executing a UseWindow statement. But the default value for executing a UseWindow is 30 seconds and so the script fails. To increase this default wait time, before the UseWindow statement, add the line:
#ActionTimeout=60
if the file dowload can take 60 seconds maximum.
And after the UseWindow statement, come back to the default value by this assignment:
#ActionTimeout=30

Syntax

#ActionTimeout=<value>

Parameters

<value>, integer, number of seconds for the object recognition timeout.

Remarks

When WinTask executes a statement, it tries to find the specified object during a maximum of #ActionTimeout seconds.  After this elapsed time, if the object is not found, Error Handling mechanism is used.

The default value for #ActionTimeout is 30 seconds.

If #ActionTimeout is set to 0, WinTask waits forever.

See also

#IgnoreErrors

Examples

#ActionTimeout=12


'This script detects if the Notepad window is present or not.
#IgnoreErrors=1  'Ignore errors: if an execution error occurs, do not display an error message
 
#ActionTimeout=10  'Wait a maximum of 10 seconds before reporting an error

'Launch notepad
shell("notepad")
'Use the Notepad window
ret=UseWindow("NOTEPAD.EXE|Edit|Untitled - Notepad|1")
 
'Test the return value of UseWindow to know if notepad is loaded or not
if ret=0 then
msgbox("Notepad window is present")
else
msgbox("Notepad window is not present")
endif