[ Previous ] [ Contents ] [ Index ] [ Next ]

How to Build and Debug Tcl Scripts

The Tcl Administration pages support editing shared and private scripts, and copying shared scripts to the private area.

  1. Follow the Tcl Scripting link on the server administration page (/NS/Admin). The relevant options on the Tcl Scripting page are:

  2. Test your script by accessing an URL that it is registered for. For example, if you registered the hello script to the /example/hello URL as follows:

        ns_register_proc GET /example/hello hello
    

    Then you would test the script by visiting the URL http://yourserver/example/hello.

  3. The ClientDebug parameter, set in the [ns/server/server-name/tcl] section of the configuration file, allows you to specify an IP address to be enabled for Tcl debugging. If an IP address is specified with this parameter, error backtraces resulting from running a Tcl script are inserted into the page. You can have multiple ClientDebug entries to specify multiple addresses. For example:

         ClientDebug=111.222.333.444
         ClientDebug=111.222.333.445
    

    You can also enable Client Debugging from the server administration page. Follow the Tcl Scripting link on the server administration page (/NS/Admin). Then follow the Enable/Disable Client Debugging link to enable or disable client debugging for a specific IP address.

  4. After testing your script, you may want to make changes to it. Follow the Tcl Scripting link on the server administration page (/NS/Admin). Then follow the link to view or edit script files in the appropriate library (private or shared). Then follow the link to your script.

    Before modifying your script, you should perform a Reload to make sure you have the most current version of the script, because you or someone else may have made edits to the script since the last time the page was cached. If you do make edits to an older version of the script, you will receive an error when you press the Update Script button, and your edits will not take effect.

    Press the Update Script button to update and evaluate your script. To test your revised script, open the URL associated with the script (such as the /example/hello URL in the above example) again in your browser and perform a Reload to see the new results.

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.