To add breakpoints to your server-side scripts written in Microsoft® JScript, insert a debugger statement before a suspect line of script. Remember to remove Stop statements from production. asp file with the statement pointer indicating the location of the stop statement. When you request the previous script using your Web browser, the debugger starts and automatically displays the. For example, a server-side script intended to sort a list of values may return an inaccurate ordering if the script contains a > sign for comparing values, when it should have used a With logical errors, which arise from typing mistakes or flaws in programmatic logic, your script runs successfully, but yields incorrect results. Logical ErrorsĪ logicalerror can often be the most insidious and difficult bug to detect. 'This statement generates a run-time error.īugs that result in run-time errors must be corrected for your script to execute without interruption. For example, the following script contains a function that divides a variable by zero (an illegal mathematical operation) and generates a run-time error: ĭocument.write ("The answer is " &Result) Run-time errors occur after your script commences execution and result from scripting instructions that attempt to perform impossible actions. Syntax errors can prevent your script from running. For example, a misspelled command or an incorrect number of arguments passed to a function generates an error. Syntax ErrorsĪ syntax error is a commonly encountered error that results from incorrect scripting syntax. Some of these errors can cause your scripts to execute incorrectly, halt the execution of your program, or return incorrect results. While debugging your server-side scripts you might encounter several types of errors. If the file contains a bug or an intentional statement to halt execution, the Microsoft Script Debugger will automatically start, display your script, and indicate the source of the error. Manually open the Microsoft Script Debugger to debug your ASP server-side scripts.For instructions and information, see Enabling ASP Debugging.Īfter enabling Web server debugging, you can use either of the following methods to debug your scripts: (This feature is not available for Windows 95, or later versions.) Enabling Debuggingīefore you can begin debugging your server-side scripts, you must first configure your Web server to support ASP debugging. To fix bugs, you must edit your script with an editing program, save your changes, and run the script again.įor more information, see Microsoft Script Debugger. Note You can use the debugger to view scripts and locate bugs, but not to directly edit your scripts. Trace procedures while running your server-side script.Set pauses to suspend execution of your server-side scripts (using either the debugger or a script command) at a particular line of script.Open a command window to monitor the value of variables, properties, or array elements, during the execution of your server-side scripts.Run your server-side scripts one line at a time. With the Script Debugger, which also works with Windows Internet Explorer version 3.0 or later, you can: The Microsoft® Script Debugger is a powerful debugging tool that can help you quickly locate bugs and interactively test your server-side scripts. This means that debugging, or the process of finding and correcting scripting errors, is crucial for developing successful and robust ASP applications. Regardless of your planning or level of experience, script errors, or bugs, may initially prevent your ASP server-side scripts from working correctly. Debugging ASP Scripts Debugging ASP Scripts
0 Comments
Leave a Reply. |