Compartilhar via


Debugging Script Components

The exact steps you take to debug your scriptlet will depend on your development environment. However, there is a tag that you must include in your scriptlet when debugging.

When you are debugging a scriptlet, you must include the following line at the top of your scriptlet file.

<?scriptlet validate="true" error="true" debug="true"?> 

This tag tells the compiler the type of error handling to use when reading the scriptlet file. Each of the three parameters in the tag is optional. The following table summarizes the effect of implementing these parameters:

Parameter

Meaning

Validate

Indicates whether the scriptlet should be checked for proper XML syntax.

Error

Indicates whether detailed error messages should be displayed when the compiler encounters syntax or run-time errors.

Debug

Indicates whether or not the script debugger will run when the compiler encounters an error.

The following example demonstrates a scriptlet that will launch the debugger.

<scriptlet> 
<?scriptlet debug="true"?> 
<Registration 
   Description="Debug" 
   ProgID="Nothing.Scriptlet" 
   Version="1.00" 
> 
</Registration> 

<implements id=Automation type=Automation> 
   <method name=stops> 
   </method> 
</implements> 

<script Language= "VBScript"> 

function stops() 
Stop   
end function 

</script> 
</scriptlet>