0

I tried to run the following Tcl script and got the error:

wrong # args: should be "set varName ?newValue?"

What does this mean?

Note: The script includes terms specific to VMD progra

set dir plugins/noarch/tcl/vmdICE1.0 source $dir pkgIndex.tcl vmd_install_extension vmdICE xrmsdgui_tk_cb "Analysis/vmdICE"                                               
Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • pls provide the entire error trace, not just the error message. also, the script fragment posted does not seem the one you are actually trying to run: `pkgIndex.tcl` as a command? – mrcalvin Jul 03 '18 at 13:48

1 Answers1

0

Tcl really cares about newlines. It treats them like many other languages treat semicolons, as a command terminator. (You can use semicolons in Tcl too if you want, but that's uncommon.)

Because of that, your script:

set dir plugins/noarch/tcl/vmdICE1.0 source $dir pkgIndex.tcl vmd_install_extension vmdICE xrmsdgui_tk_cb "Analysis/vmdICE"                                               

is hopelessly wrong. It's one call of a command, set, with far too many arguments. If we add in the newlines in the most likely places, we get:

set dir plugins/noarch/tcl/vmdICE1.0
source $dir pkgIndex.tcl
vmd_install_extension vmdICE
xrmsdgui_tk_cb "Analysis/vmdICE"

Now that's still wrong, but it's much closer to right. The last key bit of fixing is to make the filename to source correct:

set dir plugins/noarch/tcl/vmdICE1.0
source $dir/pkgIndex.tcl
vmd_install_extension vmdICE
xrmsdgui_tk_cb "Analysis/vmdICE"

I don't know whether that will work for you, but it at least looks sane to me.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215