APGen Documentation Previous Topic: Script.OnError Next Topic: Script.CreateObject() Parent Topic: Script Object    Script Object
Script.Abort()
See Also:

The Script.Abort() method halts execution of the script.

Syntax

VBScript:

Script.Abort

JScript:

Script.Abort();
Object

Script The Script object.

Notes

Script.Abort() halts execution of the script, and causes successful return from the Run() or RunArgs() call that ran the script.

Example

This code snippet uses Util.OpenFileDialog() to ask the user to select some web pages.  If the user clicks cancel, no files are returned, and the script Abort()s.

<%#

' Array of file paths
Dim rgInputFilePaths
          
' Prompt for input file
' Returns an Array
rgInputFilePaths = Util.OpenFileDialog("", _
          "HTML type files,*.htm;*.html;*.asp,All,*.*", _
          "Select some web pages", _
          ofdFlagFileMustExist Or ofdFlagAllowMultiSelect)
                    
If (UBound(rgInputFilePaths) < 0) Then
     ' User clicked cancel (empty array)
     Script.Abort
End If

#%>

Applies To

Script Object