I suppose the real question is why do you want to do that? Presumably, you're using
lappend because you want to build a well-formed Tcl list.
lappend automatically quotes elements as needed to maintain valid list structure. But the quotes are not part of the element value, and are automatically "stripped" when you retrieve the element value. For example:
[tt]% lappend states California "New York" "North Dakota"
California {New York} {North Dakota}
% llength $states
3
% puts "The second state is
[ignore][lindex $states 1][/ignore]"
The second state is
New York[/tt]
Looking at your two lines of example code, I'm wondering if what you're really trying to do is simple string concatenation. In that case, you should be using the
append command instead of
lappend. let's take a look at a comparison:
Code:
% append test1 "The current time is "
The current time is
% append test1 [clock format [clock seconds] -format "%I:%M:%S %p"]
The current time is 11:20:51 AM
% lappend test2 "The current time is "
{The current time is }
% lappend test2 [clock format [clock seconds] -format "%I:%M:%S %p"]
{The current time is } {11:21:21 AM}
- Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax