TCL-Kurs

Da TCL eine sehr einfache Stuktur hat, ist es meiner Meinung nach eine gute Sprache für Einsteiger in die Programmierung. Da es allerdings keine feste Syntax wie andere Sprachen hat, sollte man sich rasch einen klaren Programmierstil aneignen. Dazu sollen die folgenden Lektionen und Beispiele eine Anregung bieten.

  1. Warum TCL?
    TCL bietet für Anfänger folgende Vorteile:
  2. Einführung
  3. TCL - Herkunft und Features Herkunft: TCL wurde von Prof. John Ousterhout entwickelt. Von Sun in Firma Scriptics ausgelagert, heute in Ajuba umbenannt.
  4. Begriffe
  5. Voraussetzungen
  6. Installation
  7. Erste Schritte
  8. Syntax
  9. Evaluierung von Kommandozeilen:
  10. Variablen
  11. Arrays
  12. Listen
  13. Zeichenketten
  14. Mathematik
  15. Quoten
  16. Kommentare
  17. Fallen und häufige Fehler
    Kommentare, Oktale Zahlen, Evaluierung
  18. Aufrufparameter, Umgebungsparameter: argv enthält die Aufrufparameter, das Array env enthält die Umgebungsvariablen exec und pipe-Aufruf noch hierher!
  19. Kommandos: . after append array auto_execok auto_import auto_load auto_load_index auto_mkindex auto_mkindex_old auto_qualify auto_reset beep bell bgerror binary bind bindtags break button canvas case catch cd checkbutton clipboard clock close concat console continue destroy echo encoding entry eof error eval event exit expr fblocked fconfigure fcopy file fileevent flush focus font for foreach format frame gets glob global grab grid history if image incr info interp join label lappend lindex linsert list listbox llength load lower lrange lreplace ls lsearch lsort menu menubutton message namespace open option pack package pid pkg_compareExtension pkg_mkIndex place proc puts pwd radiobutton raise read regexp regsub rename resource return scale scan scrollbar seek selection send set socket source split string subst switch tclListValidFlags tclLog tclMacPkgSearch tclParseConfigSpec tclPkgSetup tclPkgUnknown tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tell text time tk tkButtonDown tkButtonEnter tkButtonInvoke tkButtonLeave tkButtonUp tkCancelRepeat tkCheckRadioInvoke tkDarken tkEntryAutoScan tkEntryBackspace tkEntryButton1 tkEntryClosestGap tkEntryGetSelection tkEntryInsert tkEntryKeySelect tkEntryMouseSelect tkEntryNextWord tkEntryPaste tkEntryPreviousWord tkEntrySeeInsert tkEntrySetCursor tkEntryTranspose tkEventMotifBindings tkFDGetFileTypes tkFirstMenu tkFocusGroup_BindIn tkFocusGroup_BindOut tkFocusGroup_Create tkFocusGroup_Destroy tkFocusGroup_In tkFocusGroup_Out tkFocusOK tkGenerateMenuSelect tkListboxAutoScan tkListboxBeginExtend tkListboxBeginSelect tkListboxBeginToggle tkListboxCancel tkListboxDataExtend tkListboxExtendUpDown tkListboxMotion tkListboxSelectAll tkListboxUpDown tkMbButtonUp tkMbEnter tkMbLeave tkMbMotion tkMbPost tkMenuButtonDown tkMenuDownArrow tkMenuDup tkMenuEscape tkMenuFind tkMenuFindName tkMenuFirstEntry tkMenuInvoke tkMenuLeave tkMenuLeftArrow tkMenuMotion tkMenuNextEntry tkMenuNextMenu tkMenuRightArrow tkMenuUnpost tkMenuUpArrow tkMessageBox tkPostOverPoint tkRecolorTree tkRestoreOldGrab tkSaveGrabInfo tkScaleActivate tkScaleButton2Down tkScaleButtonDown tkScaleControlPress tkScaleDrag tkScaleEndDrag tkScaleIncrement tkScreenChanged tkScrollButton2Down tkScrollButtonDown tkScrollButtonUp tkScrollByPages tkScrollByUnits tkScrollDrag tkScrollEndDrag tkScrollSelect tkScrollStartDrag tkScrollToPos tkScrollTopBottom tkTabToWindow tkTearOffMenu tkTextAutoScan tkTextButton1 tkTextClosestGap tkTextInsert tkTextKeyExtend tkTextKeySelect tkTextNextPara tkTextNextPos tkTextNextWord tkTextPaste tkTextPrevPara tkTextPrevPos tkTextResetAnchor tkTextScrollPages tkTextSelectTo tkTextSetCursor tkTextTranspose tkTextUpDownLine tkTraverseToMenu tkTraverseWithinMenu tk_bisque tk_chooseColor tk_chooseDirectory tk_dialog tk_focusFollowsMouse tk_focusNext tk_focusPrev tk_getOpenFile tk_getSaveFile tk_menuSetFocus tk_messageBox tk_optionMenu tk_popup tk_setPalette tk_textCopy tk_textCut tk_textPaste tkwait toplevel trace unknown unset unsupported1 update uplevel upvar variable vwait while winfo wm
  20. Prozeduren
    auto_execok auto_import auto_load auto_load_index auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror history pkg_compareExtension pkg_mkIndex tclListValidFlags tclLog tclMacPkgSearch tclParseConfigSpec tclPkgSetup tclPkgUnknown tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tkButtonDown tkButtonEnter tkButtonInvoke tkButtonLeave tkButtonUp tkCancelRepeat tkCheckRadioInvoke tkDarken tkEntryAutoScan tkEntryBackspace tkEntryButton1 tkEntryClosestGap tkEntryGetSelection tkEntryInsert tkEntryKeySelect tkEntryMouseSelect tkEntryNextWord tkEntryPaste tkEntryPreviousWord tkEntrySeeInsert tkEntrySetCursor tkEntryTranspose tkEventMotifBindings tkFDGetFileTypes tkFirstMenu tkFocusGroup_BindIn tkFocusGroup_BindOut tkFocusGroup_Create tkFocusGroup_Destroy tkFocusGroup_In tkFocusGroup_Out tkFocusOK tkGenerateMenuSelect tkListboxAutoScan tkListboxBeginExtend tkListboxBeginSelect tkListboxBeginToggle tkListboxCancel tkListboxDataExtend tkListboxExtendUpDown tkListboxMotion tkListboxSelectAll tkListboxUpDown tkMbButtonUp tkMbEnter tkMbLeave tkMbMotion tkMbPost tkMenuButtonDown tkMenuDownArrow tkMenuDup tkMenuEscape tkMenuFind tkMenuFindName tkMenuFirstEntry tkMenuInvoke tkMenuLeave tkMenuLeftArrow tkMenuMotion tkMenuNextEntry tkMenuNextMenu tkMenuRightArrow tkMenuUnpost tkMenuUpArrow tkMessageBox tkPostOverPoint tkRecolorTree tkRestoreOldGrab tkSaveGrabInfo tkScaleActivate tkScaleButton2Down tkScaleButtonDown tkScaleControlPress tkScaleDrag tkScaleEndDrag tkScaleIncrement tkScreenChanged tkScrollButton2Down tkScrollButtonDown tkScrollButtonUp tkScrollByPages tkScrollByUnits tkScrollDrag tkScrollEndDrag tkScrollSelect tkScrollStartDrag tkScrollToPos tkScrollTopBottom tkTabToWindow tkTearOffMenu tkTextAutoScan tkTextButton1 tkTextClosestGap tkTextInsert tkTextKeyExtend tkTextKeySelect tkTextNextPara tkTextNextPos tkTextNextWord tkTextPaste tkTextPrevPara tkTextPrevPos tkTextResetAnchor tkTextScrollPages tkTextSelectTo tkTextSetCursor tkTextTranspose tkTextUpDownLine tkTraverseToMenu tkTraverseWithinMenu tk_bisque tk_dialog tk_focusFollowsMouse tk_focusNext tk_focusPrev tk_menuSetFocus tk_messageBox tk_optionMenu tk_popup tk_setPalette tk_textCopy tk_textCut tk_textPaste unknown
  21. Tk
  22. Widgets
    button canvas frame label listbox menu message scale scrollbar text
  23. Widgets positionieren - Pack und Grid
  24. Widgets konfigurieren
  25. Events und Binding
  26. Image-Unterstützung
  27. Dialogboxen: tk_getOpenFile, tk_getSaveFile, tk_messageBox
  28. Windowmanager
  29. Widget-Sammlungen
  30. Objektorientierung
  31. Besonderheiten verschiedener Plattformen
  32. Packages
  33. Namespaces
  34. Libraries
  35. Programmorganisation
  36. Entwicklung und Testen
  37. Benchmarks
  38. Auslieferung, Wrappen und Kompilieren
  39. Lizenzen, Verkauf, rechtliche Bestimmungen
  40. TCL als Glue
  41. Zeichensätze und NLS
  42. Socketprogrammierung
  43. TCL selbst übersetzen
  44. TCL-Kommandos in C schreiben
  45. TCL-Interpreter in C-Programme einbinden
  46. Vergleich mit anderen Skriptsprachen
    bash etc. Basic Perl Python
  47. Vergleich mit anderen Programmiersprachen
    Forth von Brodie? Delphi von Borland Labwindows/CVI von National Instruments Oberon von Niklaus Wirth Visual Basic von Microsoft
  48. Übungen
  49. Beispiele
    1. Variablen setzen und ausgeben
      % set a 3
      3
      % puts $a
      3
      % incr a
      4
      % set a
      4
    2. Textfenster
      % text .t
      .t
      % button .q -text Quit -command exit
      .q
      % pack .t .q

    3. Zeichenketten
      % set a "Dies ist ein Test"
      Dies ist ein Test
      % string length $a
      17
    4. Listen
      % set a "eins zwei drei"
      eins zwei drei
      % llength $a
      3
    5. Graphikfenster
    6. HTTP-Server Verweis auf tclhttpd und minihttpd
    7. cgi-Skripte Beispiele in tclhttpd und aform.cgi
    8. Wiki Beispiel 'großes' Wiki und eigenes awiki.cgi
    9. TCL und HTML Routinen aus webtool zur Erstellung dieser Webseiten
    10. TCL und XML Verweis auf Business-Tools von Scriptics, XML-Editor und eigene Routinen
  50. Erweiterungen

Letzte Änderung am 13.1.2002 von Axel Nagelschmidt. Seit ihrer Erstellung am 6.5.2000 wurde diese Seite 5 mal überarbeitet. Das entspricht etwa einer Bearbeitung alle 123 Tage.