Re: How to treat puts <value> as pure text - not a command
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 15:43:08 +0200
Hi,
is this the error you get:
#############################
missing close-brace
while executing
"while { [gets $infile in_line] >=0 } {
set open_comment [lsearch -exact $in_line "/*"]
set close_comment [lsearch -exact $in_line "*/"]
if {$op..."
(file "bracing.tcl" line 2)
#################################################
as input tested the next 3 lines:
ljslfs {
{
}
now: $in_line is a string and _not_ a proper list
the way to find your comments would be better served by
string first $in_line "/*"
which would return the index of the first found incidence, or -1 ...
<man n string>
string first string1 string2 ?startIndex?
Search string2 for a sequence of characters that exactly match
the characters in string1. If found, return the index of the
first character in the first such match within string2. If not
found, return -1. If startIndex is specified (in any of the
forms accepted by the index method), then the search is con-
strained to start with the character in string2 specified by the
index. For example,
string first a 0a23456789abcdef 5
will return 10, but
string first a 0123456789abcdef 11
will return -1.
uwe
.
- References:
- Prev by Date: Re: How to treat puts <value> as pure text - not a command
- Next by Date: Re: newbe q.: How to read windows path names from a file ?
- Previous by thread: Re: How to treat puts <value> as pure text - not a command
- Next by thread: Re: How to treat puts <value> as pure text - not a command
- Index(es):
Relevant Pages
|