Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

0
Posted

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?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123