% text .t
% pack .t
% .t get 1.0 end
% set x [.t get 1.0 end]
% puts [string length $x]
1
What is in x exactly?
Mark
The end-of-line character that marks the end-of-text.
Regards,
Arjen
You can check for yourself:
% pack [text .t]
(6247) 2 % set it [.t get 1.0 end]
(6247) 4 % format %02x [scan $it %c]
0a
(6247) 5 %
and \x0A is ASCII LF = \n
The trailing newline that ALWAYS exists at the end of the
contents of any textbox, try as you might to get rid of it.
I'm sure there is a perfectly good reason for this, but
I have to confess that I find it to be an accursed nuisance.
It's easy to deal with it when you know it's there...
set x [.t get 1.0 end-1c]
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan...@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
puts [string length $x]
binary scan $x H* hex
puts $hex
-->
1
0a
uwe