| 1 | = !TclBind = |
| 2 | [[TracNav(TracNav/TOC_Development)]] |
| 3 | |
| 4 | !TclBind is a connection between the Tcl library (read [http://www.tcl.tk this] for more information) and Orxonox. Tcl is used by the [wiki:CommandExecutor] to execute nested commands and scripts. |
| 5 | |
| 6 | There are two important C++ functions in !TclBind: |
| 7 | * '''tcl('''''command''''')''': Executes a tcl command (also available as a [wiki:ConsoleCommand]) |
| 8 | * '''eval('''''command''''')''': Executes a tcl command and returns the returnvalue |
| 9 | |
| 10 | On the other hand, !TclBind defines some new Tcl procedures: |
| 11 | * '''execute''' ''command'': Executes a !ConsoleCommand in the !CommandExecutor |
| 12 | * '''query''' ''command'': Executes a !ConsoleCommand in the !CommandExecutor and returns the returnvalue |
| 13 | * '''crossquery''' ''id'' ''command'': Sends a command to another Tcl interpreter (see [wiki:TclThreadManager]) |
| 14 | |
| 15 | If Tcl finds an unknown procedure, it automatically passes the command via '''execute''' to the [wiki:CommandExecutor]. This allows you to call Orxonox commands within Tcl wihtout defining a Tcl alias for every Orxonox command. |
| 16 | |
| 17 | Additionally the native Tcl procedure '''puts''' sends it's output to the [wiki:OutputHandler] instead of directly using the standard output device. |
| 18 | |
| 19 | Learn more about Tcl in the Tcl-wiki: [http://wiki.tcl.tk/] |