Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's wrong with my script? 1

Status
Not open for further replies.

kukelyk

Technical User
Mar 23, 2005
57
0
0
HU
i wrote this:

Code:
#=============================================================================================================
#create directories into drive W:\\ for the name "number.string"
#and create subdirs.
#=============================================================================================================

entry .e4 -width 10 -textvariable munkaszam 
grid .e4 -row 1 -column 1 -columnspan 1 -rowspan 1

entry .e5 -width 20 -textvariable megrendelo 
grid .e5 -row 1 -column 2 -columnspan 1 -rowspan 1;#define input boxes

set ::munkaszam "munkaszám"
set ::megrendelo "megrendel?"; #set defaults
#----------------------------------
#define buttons

button .esc -text ESC -command {exit};#define buttons
button .ok -text OK -command \
{	
	cd W:\\
	set dirname $munkaszam
	append dirname .
	append dirname [string toupper $megrendelo];#set directory name

	set fid [open W:\\used.msz RDWR]; #read file containing used project numbers
	set origi [read $fid]
	close $fid

#check if the new project number exist
	if [string match "*$munkaszam*" $origi] \
	{
		file mkdir $dirname
		cd $dirname

#create directory structure
		file mkdir ajanlat
		file mkdir ajanlat\\in_out
		file mkdir ajanlat\\fromTechno
		file mkdir dok
		file mkdir from
		file mkdir techno
		file mkdir cnc\\cad
		file mkdir cnc\\prg\\enshu
		file mkdir cnc\\prg\\mte
		file mkdir cnc\\prg\\morinv
		file mkdir cnc\\prg\\mori5ax
		#file mkdir cnc\\prg\\mazakET
		file mkdir cnc\\prg\\mori
		file mkdir cnc\\prg\\matsuura
		file mkdir cnc\\prg\\m1000
		file mkdir meo
#call batch file
		exec W:\\user_rights.bat

#write newm project number into the file of the used project numbers
		open $fid
		puts $fid "$munkaszam"
		close $fid
#close app
		destroy .
	}else{
		tk_messageBox -message "A(z) $munkaszam munkaszámhoz már létezik könyvtár" -type ok -icon error
	}

}
#---------------------------------------
#display buttons
grid .esc -row 2 -column 1
grid .ok -row 2 -column 2  -columnspan 2 -rowspan 1
when i try to execute this, it gives an error:

Code:
extra characters after close-brace
    while compiling
"if [string match "*$munkaszam*" $origi]  {
		file mkdir $dirname
		cd $dirname

#create directory structure
		file mkdir ajanlat
		file mkdir ajanlat\..."
    invoked from within
".ok invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 24)
    invoked from within
"tk::ButtonUp .ok"
    (command bound to event)
 
thanks.
i found it in the meantime..
 
azt gondoltam én vok az egyetlen magyar, aki TCL-lel foglalkozgat..üdv!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top