Debugging ASP Scripts

Source: Internet
Author: User
No matter how sophisticated and experienced your plan is, scripting errors (bugs) may initially make your ASP server-side scripts run incorrectly. That is, debugging, that is, finding and correcting script errors, is important for developing a successful and robust ASP program.
Microsoft Script Debugging Tools
microsoft& #174; Script Debugger is a powerful debugging tool that helps you quickly find errors and interactively test your server-side scripts. The Script Debugger works with Windows Internet Explorer version 3.0 or later. Through it, you can:
Run server-side scripts line-by-row.
When the server-side script executes, open a command window to monitor the values of variables, attributes, or array elements.
Set the pause flag on a specific line to suspend the server-side script (using the Debug tool or Script command).
Tracks the process when running server-side scripts.
Note You can use the Debugging tools to view the script and find the error, but you cannot edit the script directly. To correct the error, you must edit the script with the editor and save it, and then run the script.
(This feature is not available for Windows 95 or higher versions.) )
Enable debugging
Before you start debugging server-side scripts, you must first configure the WEB server to support ASP debugging.
After you enable WEB server debugging, you can debug the script using either of the following methods:
Manually open the Microsoft Script Debugger and debug ASP server-side scripts.
Use Internet Explorer to request. asp files. If the file contains an error or a human-added stop execution statement, the Microsoft Script Debugger starts automatically, displays the script, and indicates the source of the error.
Script error
When you debug a server-side script, you may encounter various types of errors. Some of these errors make the script not execute correctly, the program stops executing, or returns an error result.
Syntax error
Syntax errors are frequently encountered errors that are caused by incorrect scripting syntax. For example, a command spelling error or incorrect arguments passed to a function will produce an error. A syntax error may cause your script to not run.
Run-time error
A run-time error is the result of a script instruction attempting to perform an impossible action during execution. For example, the following script contains a function that is 0 apart (an illegal mathematical operation), which results in a run-time error:
<script language = "VBScript" runat = server>
result = Findanswer (15)
document.write ("The answer is" &result)
Function Findanswer (x)
' This statement generates a run-time error.
Findanswer = x/0 End Function
</script>
You must correct the error that caused the Run-time error so that the script will not be interrupted at run time.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.