Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Tcl error - extra characters after close-quote

Status
Not open for further replies.

chetu

Junior Member level 2
Joined
Aug 1, 2008
Messages
22
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,396
Tcl error

Can u tel me what is this error in the following program..

proc option_read { option } {
set fileid [open "inp.txt",r];
while { [eof $fileid] != 1 } {
gets $fileid line;
set firstline [lindex $line 0];
if {$firstline == $option } {
set return_val [lindex $line 1];
return $return_val;
}
}
close $fileid;
}
set Input_format [option_read "Input_format"];
vcom -2002 s_q_u.vhd;
vcom -2002 test.vhd;
if { $Input_format == 1} {
set seq [ option_read "seq_val1"];
} else {
set seq [ option_read "seq_val2"];
}
============== i am reading some variables from inp.txt file those are user inputs. trying to pass that variables to my vhdl code.
while executing this i got following error...
# ** Error: extra characters after close-quote
# Error in line 13
not getting what is this error since i am new to Tcl.
 

Re: Tcl error

check this line for correct execution..

set Input_format [option_read "Input_format"]

I dont know which tool you are using, try to execute this line in that tool shell.
 

Re: Tcl error

I am using modelsim.. i need to exicute that in modelsim itself.
i tried but its giving the same error..the way i am calling procedure is correct?
any other method ?
 

Re: Tcl error

proc option_read { option } {
set fileid [open "inp.txt" r]
while {[gets $fileid line] >= 0} {
set firstline [lindex $line 0]
if {$firstline == $option } {
set return_val [lindex $line 1]
}
}
close $fileid
return $return_val
}

Try this procedure..
 

    chetu

    Points: 2
    Helpful Answer Positive Rating
Re: Tcl error

Ya .. its wrking and returning expected value.. but can u tell me wht is the err in my code?
 

Re: Tcl error

normally we dont use ';' in tcl.. you have used 'return' in the wrong place.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top