18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Debug<br />

NOTE: the Debug object is not currently compatible with IWS. The Debug object is<br />

documented <strong>for</strong> consistency purposes only.<br />

Function The Debug object is an intrinsic global object that can send an output to a script debugger, such<br />

as the Microsoft Script Debugger.<br />

Remarks The Debug object cannot be created directly, but it is always available <strong>for</strong> use.<br />

The Write and WriteLine methods of the Debug object display strings in the Immediate window<br />

of the Microsoft Script Debugger at run time. If the script is not being debugged, the methods<br />

have no effect. 2<br />

Method Write<br />

Description Sends strings to the script debugger<br />

Usage Debug.Write ([str1 [,str2 [, …[, strN]]]]<br />

Arguments str1...strN<br />

Optional. Strings to send to the script debugger<br />

Remarks The Write method sends strings to the Immediate window of the Microsoft Script Debugger at run<br />

time. If the script is not being debugged, the Write method has no effect.<br />

The Write method is almost identical to the WriteLine method. The only difference is that the<br />

WriteLine method sends a newline character after the strings are sent.<br />

Example Dim counter<br />

Counter = 30<br />

Debug.Write “The value of counter is “ & counter<br />

Method WriteLine<br />

Description Sends strings to the script debugger, followed by the newline character<br />

Usage Debug.WriteLine ([str1 [,str2 [, …[, strN]]]]<br />

Arguments str1...strN<br />

Optional. Strings to send to the script debugger<br />

Remarks The WriteLine method sends strings to the Immediate window of the Microsoft Script Debugger<br />

at run time. If the script is not being debugged, the WriteLine method has no effect.<br />

The WriteLine method is almost identical to the Write method. The only difference is that the<br />

Write method does not send a newline character after the strings are sent.<br />

Example Dim counter<br />

Counter = 30<br />

Debug.Write “The value of counter is “ & counter<br />

Err<br />

Function Contains in<strong>for</strong>mation about the last run-time error. Accepts the Raise and Clear methods <strong>for</strong><br />

generating and clearing run-time errors.<br />

Usage val = Err.Property<br />

Err.Method<br />

Arguments Varies with properties and methods used (see below)<br />

Remarks The Err object is an intrinsic object with global scope — there is no need to create an instance of<br />

it in your code. The properties of the Err object are set by the generator of an error — <strong>VBScript</strong>,<br />

an Automation object, or the <strong>VBScript</strong> programmer.<br />

The default property of the Err object is Number. Err.Number contains an integer and can be<br />

used by an Automation object to return an SCODE.<br />

When a run-time error occurs, the properties of the Err object are filled with in<strong>for</strong>mation that<br />

uniquely identifies the error and in<strong>for</strong>mation that can be used to handle it. To generate a run-time<br />

error in your code, use the Raise method.<br />

2 See http://msdn.microsoft.com <strong>for</strong> additional in<strong>for</strong>mation on the Microsoft Script Debugger<br />

198 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!