Timeout Property

 

Description

 

Sets or returns the time, in milliseconds, after which a user is presented with the option to discontinue scripting code execution or allow it to continue. Read/write.

 

PowerBASIC Syntax

 

PROPERTY GET Timeout () AS LONG

PROPERTY SET Timeout (BYVAL plMilliseconds AS LONG)

 

Arguments

 

plMilliseconds

Number of milleseconds.

If value is specified using the NoTimeout constant (-1), no timeout is used. When value is 0, the Timeout event occurs as soon as it is determined that a running script is hung for any reason.

 

Remarks

 

When a timeout occurs, ScriptControl checks the AllowUI property on all running ScriptControl objects to see whether it is permitted to display user-interface elements.

 

If the AllowUI property is True for any of the running controls, when a timeout occurs, the user is alerted with a dialog box. Selecting End causes causes the ScriptControl to stop the execution of all scripting engines until all engines have been removed from the call stack. Selecting Continue causes scripting code execution to continue for another timeout period based on the minimum value of the Timeout property for all currently running scripting engines. At the end of each timeout period, the dialog box is displayed, and user action is again required.

 

If the AllowUI property is False when a timeout occurs, the script execution is immediately ended, and the user receives no notification of what happened.

 

Example [PowerBASIC]

 

#INCLUDE "MSSCRIPT.INC"

 

DIM pSc AS IScriptControl

 

' Creates an instance of the Microsoft Script Control

pSc = NEWCOM "MSScriptControl.ScriptControl"

' Set timetout to 1 second

pSc.TimeOut = 1000

 

Valid XHTML 1.0 Transitional