summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--doc/format.n9
-rw-r--r--doc/scan.n8
3 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fe56c9..1f3cea0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * doc/format.n, doc/scan.n: Added examples for converting between
+ characters and their numeric interpretations following user prompting.
+
2006-06-13 Donal K. Fellows <dkf@users.sf.net>
* unix/tclLoadDl.c (TclpDlopen): Workaround for a compiler bug in Sun
diff --git a/doc/format.n b/doc/format.n
index f3d45bf..7050ee3 100644
--- a/doc/format.n
+++ b/doc/format.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: format.n,v 1.13 2006/04/25 18:30:55 dgp Exp $
+'\" RCS: @(#) $Id: format.n,v 1.14 2006/06/14 14:59:03 dkf Exp $
'\"
.so man.macros
.TH format n 8.1 Tcl "Tcl Built-In Commands"
@@ -201,6 +201,13 @@ which will then be converted to the corresponding character value.
The size modifiers are ignored when formatting floating-point values.
The \fBll\fR modifier has no \fBsprintf\fR counterpart.
.SH EXAMPLES
+Convert the numeric value of a UNICODE character to the character
+itself:
+.CS
+set value 120
+set char [\fBformat\fR %c $value]
+.CE
+.PP
Convert the output of \fBtime\fR into seconds to an accuracy of
hundredths of a second:
.CS
diff --git a/doc/scan.n b/doc/scan.n
index 8dc72c9..295bd38 100644
--- a/doc/scan.n
+++ b/doc/scan.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: scan.n,v 1.17 2006/04/26 04:41:10 dgp Exp $
+'\" RCS: @(#) $Id: scan.n,v 1.18 2006/06/14 14:59:03 dkf Exp $
'\"
.so man.macros
.TH scan n 8.4 Tcl "Tcl Built-In Commands"
@@ -194,6 +194,12 @@ modifier has no \fBsscanf\fR counterpart.
If the end of the input string is reached before any conversions have been
performed and no variables are given, an empty string is returned.
.SH EXAMPLES
+Convert a UNICODE character to its numeric value:
+.CS
+set char "x"
+set value [\fBscan\fR $char %c]
+.CE
+.PP
Parse a simple color specification of the form \fI#RRGGBB\fR using
hexadecimal conversions with substring sizes:
.CS