home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume17 / tcl-editor / part02 / tclLib / cmd.tcl < prev    next >
Encoding:
Text File  |  1992-03-18  |  620 b   |  30 lines

  1. proc CreateCmdInfo {{file ../doc/cmds.tex}} {
  2.     global CmdName CmdInfo
  3.     set CmdName ""
  4.     set CmdInfo ""
  5.     set fid [open $file r]
  6.     set gettingPara 0
  7.     while {![eof $fid]} {
  8.         set line [gets $fid]
  9.         if {[string index $line 0]=="\\" && $gettingPara} {
  10.             set gettingPara 0
  11.             lappend CmdInfo $para
  12.         }
  13.         if $gettingPara {
  14.             set para [format "%s %s" $para $line]
  15.         }
  16.         if [regexp "\\subsubsection{(.*)}" $line junk cmd] {
  17.             set gettingPara 1
  18.             lappend CmdName [lindex $cmd 0]
  19.             set para [format "%s\n" $cmd]
  20.         }
  21.     }
  22.     if $gettingPara {
  23.         lappend CmdInfo $para
  24.     }
  25. }
  26. #CreateCmdInfo
  27. #foreach x $CmdInfo {
  28. #    puts stdout "<$x>"
  29. #}
  30.