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!

set command

Status
Not open for further replies.

loclong

Technical User
Aug 3, 2001
7
CA
I tried to run the expect script with the set command and it gave me a error. This is copied from another script file. Usually the set command doesn't have the ( ) around the variable..so is it a correct syntax or I have a wrong tcl version

Thanks

set g(NodeId) [lindex $argv 0]
set g(Card) [lindex $argv 1]
set g(Outfile) [lindex $argv 2]


syntax error at line 2: `(' unexpected


Thanks
 
I just ran successfully the following with tcl 8.2 –

set argv {1 2 3}

set g(NodeId) [lindex $argv 0]
set g(Card) [lindex $argv 1]
set g(Outfile) [lindex $argv 2]

The parenthesis specify an associative array. In your case you create an array g with three elements.

So, it's really interesting that you get a syntax error.

Hope it helps,
Dan
 
I can get the same error, but only if i try running from the native shell. Try launching tclsh and then executing your program from there.
Just type:

source filename.tcl
OR
source filename.htk


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top