Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL error

Status
Not open for further replies.

NewDlac

Programmer
Apr 12, 2007
1
US
I am getting the following error in a TCL statement...

[xlt :xlat:ERR /0: ba13_xlate:04/11/2007 15:46:49] Tcl error:
msgId = message0
proc = 'backslash_sub'
args = ''
result = 'extra switch pattern with no body, this may be due to a comment incorrectly placed outside o
f a switch body - see the "switch" documentation'
errorInfo: '
extra switch pattern with no body, this may be due to a comment incorrectly placed outside of a switch body - s
ee the "switch" documentation
while executing
"switch -exact -- $mode {
start {
return "" ;# Nothing specific
}

run {
# The following lines will e..."
(procedure "backslash_sub" line 5)
invoked from within
"backslash_sub {MSGID message0} {CONTEXT xlt_pre} {ARGS {}} {MODE run} {VERSION 3.0}"'


has anyone seen this error, before
 
Seems to me that you did some mistake with the switch syntax.

The switch command can use two syntaxes.
The error message said that you used the first.

Here is a correct use of this syntax:
Code:
  switch -glob -- $mode \
  {
    start { return ""; # a comment }
    run    
    {
      # a comment
      a command
    }
    default { ... }
  }

Here is a faulty use of this syntax:
Code:
  switch -glob -- $mode \
  {
    start { return ""; # a comment }
    # a comment outside of any inner script
    default { ... }
  }

The error message said that you did it! ;-)

More info at:
HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top