Click here to go immediately to the tutorial lesson itself.
This is a very flexible language allowing you to write procedures (or subroutines), control the flow of the program using conditional statements (e.g., if) and do repeated operations (e.g., for). It allows you to write customized application procedures at the user-interface level instead of having to modify the program itself.
A few basic concepts are central to understanding BTCL:
For example, in the MAIN COMMANDS section of the input file example that accompanies this tutorial:
$mindist = 10.0This assigns the value of the variable mindist to be 10.0. When this value is later passed to the procedure fixorientation, $mindist has to be used instead of only mindist. Using the latter would cause an error, because the program expects a number, but mindist is a string.
Another example in the MAIN COMMANDS section is:
for {$j = 0} {$j <= $numspin} {incr j} {works, but
for {$j=0} ....does not.
This is because TCL interprets $j=0 as one string variable and there is no such thing. Hence it is important to put a space between a variable and an operation sign.
Command argument argument ...
For example, in the definition of the procedure in the input file called fixorientation:
geometry ang12 angle $axis1 $axis2geometry is the command, and ang12 angle $axis1 $axis2 are all arguments.
However, not all arguments have the same function. Here, ang12 is the output and is the angle between the input lines $axis1 and $axis2. The argument angle is the operation that performs one of the functions that the geometry command is capable of performing. While ang12, axis1, axis2 are variables you can choose, angle is the operation and is defined by Biosym/MSI.
The reason why ang12 does not have a $ is that the value of this string variable has already been updated in the subroutines that perform the geometry command.
For example, use:
echo $axis1 geometry#5To print out the value of that geometry object, the geometry command has to be used:
echo axis1 = [geometry $axis1] axis1 = line {{11.0926 17.2649 3.27548}} {{-0.821539 0.123481 0.55662}}where the first { } contain the x, y,and z coordinates of the centroid of that line and the second { } contain the direction of the line.
The backslash \ at the end of a line indicates that the following line is a continuation of that line. Make sure there is no space after the backslash.
Copyright Biosym/MSI