: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.
<P>

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 <B>Computer User</B> from
the <B>Terseness Level</B> anytime you wish more detailed explanations. 

<P>
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:
<UL>
<UL>
<LI>^N .... Next line
<LI>^P .... Previous line
<LI>^A .... Beginning of line
<LI>^E .... End of line
<LI>^F .... Forward one character
<LI>^B .... Back one character
</UL>
</UL>
<P>
The <B>Run Example</B> button will execute the script in the code window.
<P>
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 <B>Example Code</B> window, and the <B>Output</B> window will
display the output that was generated before the error, followed by an
error message. 
<P>
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 <B>tkman</B> or the Microsoft 
online help to display the appropriate man page.  If the man page does not 
exist, <B>tkman</B> will display the appropriate error message.
<P>
:TEXT_END:
<P>
:LESSON_TEXT_START_LEVEL 1:
Welcome.
<P>
This is a Computer Aided instruction in learning Tcl.
<P>
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 <B>Experienced Programmer</B>
level from the <B>Terseness Level</B> menu. 
<P>
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 <B>Terseness Level</B> 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.
<P>
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. 
<P>
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 <B>tkman</B> or the Microsoft
help window to display the
appropriate man page.  If the man page does not exist, <B>tkman</B>
will display the appropriate error message.
<P>
You can execute the example code at any time by clicking the <B>Run
Example</B> button with the left mouse button.  Any output from the
example will appear in the bottom window.
<P>
If the <B>Example Code</B> 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. 
<P>
There is a script in the middle window now.  After you click the <B>Run Example</B> 
button the bottom window will contain the string "The next line has an error",
followed by a an error message. 
<P>
Click the <B>Run Example</B> button now (if you haven't already done so),
to see what happens when you have a script with an error.
<P>
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. 
<P>
You can also edit the Code window with the emacs control key sequences:
<UL>
<UL>
<LI>^N .... Next line
<LI>^P .... Previous line
<LI>^A .... Beginning of line
<LI>^E .... End of line
<LI>^F .... Forward one character
<LI>^B .... Back one character
</UL>
</UL>
<P>
Try adding a double quote (") to the end of the second line, and click
the <B>Run Example</B> button again.
<P>
When you've played a bit with the screens, scrollbars, and buttons,
you'll be ready for the next lesson.
:TEXT_END:
<P>
:LESSON_TEXT_START_LEVEL 2:
Welcome to the Tcl tutorial.
<P>

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
<B>Computer User</B> from the <B>Terseness Level</B> menu. 

<P>
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. 
<P>
The screen is divided into four areas, the control buttons, the instruction
text, the example code, and the output from running the example code.
<P>
The instructions for the TCL lesson will always be in this box.
<P>
Above this section is a row of buttons.  These buttons control the 
way the program works.  They are:
<TABLE>
<TR>
  <TD><B>Files </B>
  <TD> Select lessons, edit fonts and colors, and exit
<TR>
  <TD> <B>Terseness </B>
  <TD> Select the amount of detail and explanation
<TR>
  <TD> <B>Next Lesson </B>
  <TD> View the next lesson
<TR>
  <TD> <B>Previous Lesson </B>
  <TD> Review the previous lesson
<TR>
  <TD> <B>Run Example </B>
  <TD> 	Run the code in the Example Code window
<TR>
  <TD> <B>Help/About </B>
  <TD> 	Displays a help screen, and the information about TclTutor
</TABLE>
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.
<P>
When you click the <B>Next Lesson, Previous Lesson,</B> or<B> Run Example </B> buttons,
the TclTutor program will immediately perform the action.  When you press
the <B>Files</B> or <B>Terseness Level</B> 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.
<P>
When you select the files menubutton you will see these choices:
<TABLE>
<TR>
  <TD> <B>Lessons</B> 
  <TD> Select the current lesson from table of contents
<TR>
  <TD> <B>Courses</B> 
  <TD>  Select which lesson series you wish to view
<TR>
  <TD> <B>Set Font Size</B> 
  <TD> Allows you to make the text larger or smaller
<TR>
  <TD> <B>Set Colors</B> 
  <TD>  Allows you to select the colors for the TclTutor Display
<TR>
  <TD> <B>Quit</B> 
  <TD>  Exit the TclTutor Program
<TR>
  <TD> Enable/Disable Activity Log
  <TD> 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.
<TR>
  <TD> Enable/Disable Mailing Log
  <TD> 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.

</TABLE>
<P>
If you find this level of explanation is too verbose, move the cursor to the
button labeled <B>Terseness Level</B> 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.
<P>
If you double click on a word in the <B>Lesson</B> or <B> Example Code</B> window,
TclTutor will attempt to invoke a copy of <B>tkman</B> or the Microsoft
help window to display the
man page for that word.  If the man page does not exist, then <B>tkman</B>
will display the appropriate error message.
<P>
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.  <B>Do not be upset by error messages.</B>
<P>
The bottom window displays the output from the code in the <B>Example code</B>
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 <B>Example Code</B> window. 
<P>
There is code in the <B>Example Code</B> window right now.  Click the left mouse button
on the <B>Run Example</B> 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 <B>Example Code</B> window will highlighted.
<P>
You can edit the code in the <B>Example Code</B> 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. 
<P>
  Try adding a double quote (") to the end of the second line, and click
the <B>Run Example</B> button again.
<P>
  When you've played a bit with the screens, scrollbars, and buttons,
you'll be ready for the next lesson.
:TEXT_END:
<P>
:CODE_START:
puts "The next line contains an error"
puts "This line needs a trailing quote
:TEXT_END:
<P>

