From b63da517866b6b78fadd725cde93692630fb13a4 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Mon, 10 Jan 2011 00:59:50 -0500 Subject: special htmlErrorMsg use instead of raw puts Ignore-this: 339d21aef6a174c70be6a5e37b455373 darcs-hash:20110110055950-067c0-a5383e3422f6ea573906e425955f244796a75b91.gz --- GradeBook.tcl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'GradeBook.tcl') diff --git a/GradeBook.tcl b/GradeBook.tcl index 0ae2308..c78875b 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -88,6 +88,10 @@ proc CreateAccessRightsTable {db} { db eval {INSERT INTO AccessRightsTable VALUES('updategrades', 1, 1, 0, 0)} } +proc htmlErrorMsg { msg } { + puts "
error: $msg
" +} + proc htmlDBout {db permission_list {sort_col {}}} { array set permission $permission_list global script_name @@ -291,14 +295,14 @@ proc UpdateGrades { permission_list user } { db eval $sql_str } errStat2 ] if { $err2 } { - puts "
the following error happen: $errStat2
" + htmlErrorMsg $errStat2 dbg "the following error happen: $errStat2" 3 } } } errStat ] if { $err } { - puts "
the following error happen: $errStat
" + htmlErrorMsg $errStat dbg "the following error happen: $errStat" 3 } } @@ -345,7 +349,7 @@ proc ChangeGrades { permission_list user } { } errStat ] puts "" if { $err } { - puts "
the following error happen: $errStat
" + htmlErrorMsg $errStat dbg "the following error happen: $errStat" 3 } puts {} @@ -356,7 +360,7 @@ proc ChangeGrades { permission_list user } { #puts "Cancel changes" } else { - puts "
error: empty column names are not permitted
" + htmlErrorMsg "empty column names are not permitted" } } @@ -385,11 +389,12 @@ proc DeleteColumn { permission_list user } { COMMIT;" set err [catch {db eval $eval_str } errStat] if { $err } { - puts "
the following error happen: $errStat
" + htmlErrorMsg $errStat dbg "the following error happen: $errStat" 3 } } else { - puts "
error: empty column names are not permitted
" + htmlErrorMsg "empty column names are not permitted" + } } @@ -403,12 +408,12 @@ proc AddColumn { permission_list user } { set eval_str [concat ALTER TABLE GradesTable ADD \"$columnname2add\" real] set err [catch {db eval $eval_str } errStat] if { $err } { - puts "
the following error happen: $errStat
" + htmlErrorMsg $errStat dbg "the following error happen: $errStat" 3 } } else { - puts "
error: empty column names are not permitted
" + htmlErrorMsg "empty column names are not permitted" } } -- cgit v1.2.3