Re: How to treat puts <value> as pure text - not a command
- From: "steve" <steven.stone4@xxxxxxxxxxxxxxx>
- Date: 31 Mar 2006 05:17:16 -0800
Hi Uwe,
This is the part doing the reading and writing...
----------------------------------------------------------------------------------
while { [gets $infile in_line] >=0 } {
set open_comment [lsearch -exact $in_line "/*"]
set close_comment [lsearch -exact $in_line "*/"]
if {$open_comment != -1} {
set comment_flag 1
}
if {!$comment_flag} {
set title [lindex [split $in_line :] 0] ; #split line at :
set text [lindex [split $in_line :] 1]
switch -glob -- $title {
"TMS ID" {
puts $error_log "writing out TMS ID..."
gets $template out_line
set temp_title [lindex [split $out_line :] 0]
set out_line [concat $temp_title : $text]
puts $outfile $out_line
}
"Test Title" {
puts $error_log "writing out Title..."
gets $template out_line
puts $error_log "Read from template $out_line"
set temp_title [lindex [split $out_line :] 0]
puts $error_log "temp title...$temp_title"
set out_line [concat $temp_title : $text]
puts $outfile $out_line
}
"Reference(s)" {
puts $error_log "Adding Livelink No. $livelink"
puts $error_log "Adding Test Case udoc mr $udoc_mr "
puts $outfile $in_line
puts $outfile "Test Plan Livelink Number $livelink."
puts $outfile "Test Case udoc mr $udoc_mr. "
}
"Dependances" {
puts $error_log "removing dependances as not required..."
}
"Included Test I.D" {
puts $error_log "removing included test id as not required..."
}
default
{
puts $outfile "$in_line"
}
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------
I've found that if the $in_line contains an unmatched '{' the script
errors with 'unmatched open brace in list'
The line being processed falls into the 'default' switch
.
- Follow-Ups:
- Re: How to treat puts <value> as pure text - not a command
- From: Bryan Oakley
- Re: How to treat puts <value> as pure text - not a command
- From: Uwe Klein
- Re: How to treat puts <value> as pure text - not a command
- From: suchenwi
- Re: How to treat puts <value> as pure text - not a command
- References:
- How to treat puts <value> as pure text - not a command
- From: steve
- Re: How to treat puts <value> as pure text - not a command
- From: Uwe Klein
- How to treat puts <value> as pure text - not a command
- Prev by Date: Re: ANNOUNCE: TIP#262 Published
- Next by Date: Re: ANNOUNCE: TIP#262 Published
- 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
|