Tcl Support

This topic describes the versions of Tcl used by 3DSpace.

This page discusses:

See Also
3DSpace
Configuring Windows Systems for Tcl

The Tcl 8.5.7 Library

The Tcl 8.5.7 library is installed and configured as the default version of Tcl with installation of the desktop applications.

To use Tcl on a Windows system, you must modify the system path environment variable.

Floating Point Calculations

The out-of-the-box Tcl 8.5.7 performs floating point calculations at a higher precision than the previously incorporated Tcl 8.3.3, which defaulted to precision=12. This can affect some floating point calculations using 'expr'. For example:

% expr 1.23 + 4.56
5.789999999999999

If this is a problem, the workaround is to add the following line to <installdir>/tcl85/lib/tcl8.5/init.tcl:

set tcl_precision 12

Adding this line gives you the same results as in Tcl 8.3.3:

% expr 1.23 + 4.56
5.79

Default Clock Command Output

When using Tcl 8.5.7, the millis subcommand should be used with the clock command. The clicks subcommand is unreliable and should not be used.

Incorrect Syntax in the Catch Command

Be aware that in Tcl versions before Tcl 8.5.7, Tcl was more lenient with the syntax used in the catch command. The correct syntax is catch BLOCK1 BLOCK2, where BLOCK1 and BLOCK2 are bracketed with curly braces { } and not square brackets [ ]. The [ ] brackets force evaluation prior to entering the catch command, which makes the command useless. Tcl 8.5.7 enforces the use of { }.