What is the entry point of a TCL program when it is executed by the RUN command? Is it just like C, which must be started from a function called main?
The rule to start executing a TCL program is not the same as that for a standard C program. There is no need for a function named ‘main’ in a TCL program file, since the TCL interpretor always starts the execution from the first function encountered in the program file. The cause of this difference is obvious. The C is a complier language and its compiled modules must be linked with other modules and libraries to form an executable file, and thus the entry point must be determined uniquely by the name of function. Yet, it is not necessary to force the TCL programmer to use a fixed function name for program entry point, since the TCL, being an interpretor, does not have the module-linking problem. Of course, if you are used to writing C program, you might want to name the entry function of your TCL program as main(), as long as you put it at the beginning of the program. Some folks like to make different TCL functions into separate files, and use ‘#include’ directive to include these fu
Related Questions
- Why do I get "Exception in thread main java.lang.NoClassDefFoundError:" when trying to run my first Java Sound program?
- How to pass parameter values to an external TCL application executed via command("RUN ...") function call?
- BACK to APUSH Information Main Page Q. Why was the Advanced Placement program started?