![]() ![]() Remember to remove Stop statements from production. At this point you could choose to inspect the values assigned to variables before passing those variables to the component. asp file with the statement pointer indicating the location of the Stop statement. When you request this script, 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 > (greater than) sign for comparing values, when it should have used a With logical errors, which are caused by typing mistakes or flaws in programmatic logic, your script runs successfully, but yields incorrect results. Logical ErrorsĪ logical error can be the most 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, Script Debugger will automatically start, display your script, and indicate the source of the error. ![]() Open Script Debugger and use it to run and debug your ASP server-side scripts. WScript.Echo("After: AppAllowDebugging = " & IIsWebVirtualDirObj.AppAllowDebugging)Īfter enabling Web server debugging, you can use either of the following methods to debug your scripts: IIsWebVirtualDirObj.Put "AppAllowDebugging", True 'IIsWebVirtualDirObj.AppAllowDebugging = True ' There are multiple ways to set a property: WScript.Echo("Before: AppAllowDebugging = " & IIsWebVirtualDirObj.AppAllowDebugging) Set IIsWebVirtualDirObj = GetObject("IIS://localhost/W3SVC/1/Root") ' In this case, we're connecting to the root virtual directory of the Default Web Site. To enable server-side debugging programmatically using ADSI in a VBScript script, use the following code example: ' Connect to an object for the Web service, Web site, virtual directory or Web file. Select the Enable ASP server-side script debugging check box. An application must be created for the button to be active. ![]() Under Application Settings, click Configuration. In the Properties pages for any Web site or Web virtual directory, click the Home Directory or Virtual Directory tab. To enable server-side debugging using IIS Manager: 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. You cannot use Microsoft Script Debugger to directly edit your scripts, only to locate bugs. 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. You can do the following things using the features of Microsoft Script Debugger: ![]() The Microsoft Script Debugger is a powerful debugging tool that can help you quickly locate bugs and interactively test your server-side scripts. For this reason, debugging, the process of finding and correcting scripting errors, is crucial for developing successful and robust ASP applications, especially as the complexity of your application grows. Regardless of your level of experience, you will encounter programmatic errors, or bugs, that will prevent your server-side scripts from working correctly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |