beautypg.com

Using tcl, Procedures and command execution – Sensoray 2224 Windows User Manual

Page 76

background image

Using TCL

Upon selecting TCL from the Tools menu, an interactive (console) environment is setup for running and
creating TCL scripts.

Command can be executed one at a time, saved in a file and called.

One such script is Demo.tcl located in C:\...install_path..\Sensoray\2226\Tcl

This script uses new windows GDI wrapper routines to implement a full screen overlay API that is from
20 times faster than the original Overlay API. Speedup varies depending on the actual number of pixels
contained in the overlay and the number of pixels that need to be updated.

Procedures and command execution

The user is free to run commands immediately or to create new procedures for later execution.

Procedures are defined as:

proc welcome { param } {
puts " Hello $param"
}
and can be executed by entering the procedure name, the parameter to use, and hitting enter:

welcome John
Produces:

Hello John
External scripts in files can be run by using the source command:

source ..\\..\\tcl\\demo.tcl
source ../../tcl/demo.tcl
Many of the 2226's API routines have corresponding TCL commands. See Appendix B and C for more
detailed descriptions of these.

The user is encouraged to wrap more API routines as well as their own routines into TCL commands.
This is easily done by modifying jim_TclShell.cpp using the existing commands as templates.

76

This manual is related to the following products: