summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-04-21 19:31:15 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-04-21 19:31:15 (GMT)
commit97e45523cfac9f726b851b40450824e60868f2a2 (patch)
tree023c7b3d5147ec86dc8c7bb1b913c1dfae4eeebe
parent34af8dc64d2c552ced0e64653a3bc15adba7d3c2 (diff)
downloadtcl-97e45523cfac9f726b851b40450824e60868f2a2.zip
tcl-97e45523cfac9f726b851b40450824e60868f2a2.tar.gz
tcl-97e45523cfac9f726b851b40450824e60868f2a2.tar.bz2
Added example from David Welton. [Patch 939473]
-rw-r--r--ChangeLog2
-rw-r--r--doc/bgerror.n20
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ea085b3..bbc2296 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2004-04-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * doc/bgerror.n: Added example from David Welton. [Patch 939473]
+
* doc/after.n: Added examples from David Welton. [Patch 938820]
2004-04-19 David Gravereaux <davygrvy@pobox.com>
diff --git a/doc/bgerror.n b/doc/bgerror.n
index a78782f..e5aa246 100644
--- a/doc/bgerror.n
+++ b/doc/bgerror.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: bgerror.n,v 1.4 2000/09/07 14:27:45 poenitz Exp $
+'\" RCS: @(#) $Id: bgerror.n,v 1.5 2004/04/21 19:33:17 dkf Exp $
'\"
.so man.macros
.TH bgerror n 7.5 Tcl "Tcl Built-In Commands"
@@ -71,6 +71,24 @@ the command to be run. The text of the stack trace is appended to the
command when it is evaluated. If either of these options is set to
the empty string, then the additional button will not be displayed in
the dialog.
+.PP
+If you are writing code that will be used by others as part of a
+package or other kind of library, consider avoiding \fBbgerror\fR.
+The reason for this is that the application programmer may also want
+to define a \fBbgerror\fR, or use other code that does and thus will
+have trouble integrating your code.
+
+.SH "EXAMPLE"
+This \fBbgerror\fR procedure appends errors to a file, with a timestamp.
+
+.CS
+proc bgerror {message} {
+ set timestamp [clock format [clock seconds]]
+ set fl [open mylog.txt a]
+ puts $fl "$timestamp: bgerror in $::argv '$message'"
+ close $fl
+}
+.CE
.SH "SEE ALSO"
after(n), tclvars(n)