I'm making a little front end for sqlite database, here is where a new record gets inserted
proc new_record {account_db key} {
upvar db_path db_path
set thisdb $db_path$account_db.db
... <some stuff> ...
grid [button .n.bottom.proceed -background grey65 -text "Add Record" -pady 3 -width 17 -command {
ad $thisdb $desc $log $pass
destroy .n
return
}]
... <more stuff> ...
}
Error says "Error: can't read "thisdb": no such variable
I try to debub using Tk_messageBox:
proc new_record {account_db key} {
upvar db_path db_path
set thisdb $db_path$account_db.db
... <some stuff> ...
tk_messageBox -message $thisdb;return
grid [button .n.bottom.proceed -background grey65 -text "Add Record" -pady 3 -width 17 -command {
ad $thisdb $desc $log $pass
destroy .n
return
}]
... <more stuff> ...
}
message box shows the varible $thisdb, which is the full path to the database file. I put the message box within the button command, I get an error, no such variable.
Obviously I'm missing something in plain sight, but I'm just not seeing it, any ideas?
The traceback:
can't read "thisdb": no such variable
can't read "thisdb": no such variable
while executing
"ad $thisdb $desc $log $pass"
invoked from within
".n.bottom.proceed invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke]"
(procedure "tk::ButtonUp" line 24)
invoked from within
"tk::ButtonUp .n.bottom.proceed"
(command bound to event)