TOC PREV NEXT INDEX

 


Compilation Errors


TclPro Compiler provides an added check that your code is syntactically correct. A benefit of compiling procedure bodies in advance is that some syntax errors are caught at compilation rather than at runtime. Because Tcl procedures in standard Tcl code are compiled on an as-needed basis, errors are not caught until you run the procedures. TclPro Compiler informs you of errors that are caught when it compiles the file.

This example shows an error message from a compilation. The file contains syntactically incorrect Tcl code.


Sample for a bad file (fail.tcl):
# note the missing close-brace
set msg {

If you run this code in an interpreter, you see the following error message:


% protclsh83.exe fail.tcl
missing close-brace
    while compiling
"set msg { ..."
    (file "fail.tcl" line 15)

If you compile, you get this output:


compilation of "fail.tcl" failed: missing close-brace

TclPro Compiler saves the error generated by the compilation. In this example, TclPro Compiler displays the string "missing close-brace" and displays the error message. You will need to fix syntax errors like this one before TclPro Compiler can compile the script. For help in tracking down errors, see Chapter 5, "TclPro Checker."




http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX