:TITLE: Introduction ;# ;# rcsid: $header: /usr/home/clif/cvs/tclxexample/lsn.0,v 1.9 1995/08/02 03:22:03 clif exp $ ;# Copyright (c) 1995 Clif Flynt ;# 9300 Fleming Rd. ;# Dexter, MI 48130 ;# clif@cflynt.com ;# See file "NOTICE" for licensing terms. ;# :LESSON_TEXT_START_LEVEL 0: Welcome to the Tcl Tutorial.

This level of detail is for the experienced programmer who needs to learn YAL (Yet Another Language). Descriptions will be terse, sometimes just the man page entry. Feel free to select Computer User from the Terseness Level anytime you wish more detailed explanations.

The code window can be edited using the mouse, backspace and delete keys. You can maneuver around the text window with the emacs control key sequences:

The Run Example button will execute the script in the code window.

The output from the script will be displayed in the bottom window. If the script has errors, the first line with an error will be highlighted in the Example Code window, and the Output window will display the output that was generated before the error, followed by an error message.

At any point in this tutorial, you may view a man page (if you have tkman installed on your system). Double click on a word in the Lesson window or Code window, and TclTutor will attempt to invoke a copy of tkman or the Microsoft online help to display the appropriate man page. If the man page does not exist, tkman will display the appropriate error message.

:TEXT_END:

:LESSON_TEXT_START_LEVEL 1: Welcome.

This is a Computer Aided instruction in learning Tcl.

This level of detail is for the student who is familiar with window based computer systems, but has little programming experience. If you find this level too verbose, try selecting the Experienced Programmer level from the Terseness Level menu.

Whenever you find explanations too terse, or if the text assumes that you know something you don't know, feel free to move the cursor to the button labeled Terseness Level then press and release the left mouse button quickly. This will display the three terseness levels, with a highlighted dot next to the current level. If you click an entry below the one that currently has a dot, the lesson will reload with more explanation.

In this tutorial you will be allowed to step your way through a set of descriptions of the Tcl language, with examples showing particular aspects of the language. The instructional text will be in this window and the examples will appear in the middle window.

At any point in this tutorial, you may view a man page (if you have tkman installed on your system). Double click on a word in the Lesson window or Code window, and TclTutor will attempt to invoke a copy of tkman or the Microsoft help window to display the appropriate man page. If the man page does not exist, tkman will display the appropriate error message.

You can execute the example code at any time by clicking the Run Example button with the left mouse button. Any output from the example will appear in the bottom window.

If the Example Code contains an error, the line with the first error will be highlighted in the Code window. The Output window will contain the output that was produced before the error occurred, followed by a brief error message.

There is a script in the middle window now. After you click the Run Example button the bottom window will contain the string "The next line has an error", followed by a an error message.

Click the Run Example button now (if you haven't already done so), to see what happens when you have a script with an error.

You can edit the code in the middle window by moving the cursor to the character you wish to change and clicking the left mouse button. At this point, you can type in new text, or delete characters with the delete or backspace key.

You can also edit the Code window with the emacs control key sequences:

Try adding a double quote (") to the end of the second line, and click the Run Example button again.

When you've played a bit with the screens, scrollbars, and buttons, you'll be ready for the next lesson. :TEXT_END:

:LESSON_TEXT_START_LEVEL 2: Welcome to the Tcl tutorial.

This tutorial is designed to allow you to learn the Tcl language at your own speed and convenience. This level of detail is for the student with very little experience with computers. If you find it tedious, select Computer User from the Terseness Level menu.

Along the right hand edge of the text windows is a vertical bar called a ScrollBar. If you put the cursor in the upper colored portion of the bar, and hold down the left or middle mouse button, you can drag that colored portion lower, and display more of this text. If you drag it up, it will display any previous text. Clicking the up and down pointing triangles with the left mouse button will move the text one line in that direction.

The screen is divided into four areas, the control buttons, the instruction text, the example code, and the output from running the example code.

The instructions for the TCL lesson will always be in this box.

Above this section is a row of buttons. These buttons control the way the program works. They are:
Files Select lessons, edit fonts and colors, and exit
Terseness Select the amount of detail and explanation
Next Lesson View the next lesson
Previous Lesson Review the previous lesson
Run Example Run the code in the Example Code window
Help/About Displays a help screen, and the information about TclTutor
These buttons can be activated by moving the cursor to the button you wish to activate (which will then change color) and pressing the left mouse button briefly.

When you click the Next Lesson, Previous Lesson, or Run Example buttons, the TclTutor program will immediately perform the action. When you press the Files or Terseness Level button, you will be presented with a menu of new choices. You can access these new selections in the same manner as their parent button, by moving the mouse cursor over the selection, and clicking the left mouse button.

When you select the files menubutton you will see these choices:
Lessons Select the current lesson from table of contents
Courses Select which lesson series you wish to view
Set Font Size Allows you to make the text larger or smaller
Set Colors Allows you to select the colors for the TclTutor Display
Quit Exit the TclTutor Program
Enable/Disable Activity Log On supported systems, TclTutor can create a log file of when you enter and leave lessons and run examples. This can be used by people using TclTutor as a teaching tool to monitor student progress.
Enable/Disable Mailing Log On supported systems, TclTutor can mail the activity log to Clif Flynt. I use these logs to figure out which lessons are taking the most time, which examples get run with errors, etc to find out what lessons need to be improved or changed.

If you find this level of explanation is too verbose, move the cursor to the button labeled Terseness Level then press and release the left mouse button quickly. This will display the three terseness levels, with a highlighted dot next to the level of the text you are currently reading. The terseness levels are listed in order of increasing verbosity.

If you double click on a word in the Lesson or Example Code window, TclTutor will attempt to invoke a copy of tkman or the Microsoft help window to display the man page for that word. If the man page does not exist, then tkman will display the appropriate error message.

The middle large section of the screen displays example code that illustrates the concepts that are being discussed in the top text window. Sometimes this script will be incomplete, or will have intentional errors. Do not be upset by error messages.

The bottom window displays the output from the code in the Example code window. If there is an error in the code, this window will contain the output of the correct portion of the script, followed by an Error break, and the error message. When an error occurs, the line with the error is highlighted in the Example Code window.

There is code in the Example Code window right now. Click the left mouse button on the Run Example button, and you will see the words "The next line has an error" followed by an error message in the bottom window. The second line in the Example Code window will highlighted.

You can edit the code in the Example Code window by moving the cursor to the character you wish to change and clicking the left mouse button. At this point, you will see a blinking vertical line where the mouse pointer is. You can type in new text, which will be entered at the blinking line, delete the character to the left of the blinking line with the backspace key, or delete the character to the right of the blinking line with the delete key.

Try adding a double quote (") to the end of the second line, and click the Run Example button again.

When you've played a bit with the screens, scrollbars, and buttons, you'll be ready for the next lesson. :TEXT_END:

:CODE_START: puts "The next line contains an error" puts "This line needs a trailing quote :TEXT_END: