head 1.2; access; symbols; locks mys:1.2; strict; comment @# @; 1.2 date 2000.08.15.22.34.50; author mys; state Exp; branches; next 1.1; 1.1 date 99.11.09.21.32.47; author mys; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @#!/usr/bin/wish8.0 # Tcltexed | Version 2.3 | 1. Feb. 1999 | Martin Strauss set Tcltexed_Version 2.3 # A plaintext-editor for LaTeX based on scriptlanguage tcl/tk (8.x) # # Copyright (C) 1998 - Martin Strauss - # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # My email-adress : mys@@phi.faveve.uni-stuttgart.de ####################################################################### # Begin of Tcltexed ####################################################################### set basepath "[file dirname [info script]]/.." ####################################################################### # If it doesn't work by it's own please enter here the right # installationpath to the base of tcltexed (not to the executable) # and uncommend the next line # set basepath /usr/local/app/tcltexed-2.2 ####################################################################### # You propably aren't interested to mix my files locations ??? set hlppath $basepath/hlp ####################################################################### # a short test looking if you set your mainpath right if {![file exists $basepath/bin/tcltexed.tcl]} { wm withdraw . tk_messageBox -icon error -message "[info script] Tcltexed\nWrong path configuration !\nPlease read the INSTALL file !\n Currently the basepath is set to\n $basepath\nbut I can't find my data there." exit } ########################################################################## ########################################################################## # You won't believe it what happens if you ... so leave it the way it is # ########################################################################## label .l -text "This program produces\n the index of help issues" label .echo button .b -text "do it !" -command {DOIT} proc DOIT {} { global hlppath cd $hlppath set FILES [glob */*.txt] set file "" foreach file $FILES { .echo configure -text $file update set f [open $file r] set Text [read $f] close $f set pos [string first "::" $Text] while {$pos!=-1} { set Text [string range $Text [expr $pos + 2] end] set pos [string first "::" $Text] set posn [string first "\n" $Text] if {$posn>$pos} { if {[string length [string range $Text 0 [expr $pos -1]]] > 0} { lappend L([string range $Text 0 [expr $pos -1]]) $file }}} } set f [open $hlppath/index w] puts $f [array get L] close $f .echo configure -text Done } pack .l .echo .b @ 1.1 log @Initial revision @ text @d1 79 a79 79 #!/usr/bin/wish8.0 # Tcltexed | Version 2.3 | 1. Feb. 1999 | Martin Strauss set Tcltexed_Version 2.3 # A plaintext-editor for LaTeX based on scriptlanguage tcl/tk (8.x) # # Copyright (C) 1998 - Martin Strauss - # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # My email-adress : mys@@phi.faveve.uni-stuttgart.de ####################################################################### # Begin of Tcltexed ####################################################################### set basepath "[file dirname [info script]]/.." ####################################################################### # If it doesn't work by it's own please enter here the right # installationpath to the base of tcltexed (not to the executable) # and uncommend the next line # set basepath /usr/local/app/tcltexed-2.2 ####################################################################### # You propably aren't interested to mix my files locations ??? set hlppath $basepath/hlp ####################################################################### # a short test looking if you set your mainpath right if {![file exists $basepath/bin/tcltexed.tcl]} { wm withdraw . tk_messageBox -icon error -message "[info script] Tcltexed\nWrong path configuration !\nPlease read the INSTALL file !\n Currently the basepath is set to\n $basepath\nbut I can't find my data there." exit } ########################################################################## ########################################################################## # You won't believe it what happens if you ... so leave it the way it is # ########################################################################## label .l -text "This program produces\n the index of help issues" label .echo button .b -text "do it !" -command {DOIT} proc DOIT {} { global hlppath cd $hlppath set FILES [glob */*.txt] set file "" foreach file $FILES { .echo configure -text $file update set f [open $file r] set Text [read $f] close $f set pos [string first "::" $Text] while {$pos!=-1} { set Text [string range $Text [expr $pos + 2] end] set pos [string first "::" $Text] set posn [string first "\n" $Text] if {$posn>$pos} { if {[string length [string range $Text 0 [expr $pos -1]]] > 0} { lappend L([string range $Text 0 [expr $pos -1]]) $file }}} } set f [open $hlppath/index w] puts $f [array get L] close $f .echo configure -text Done } pack .l .echo .b @