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.

change variable of TCL file from top

Status
Not open for further replies.

amitk3553

Advanced Member level 4
Full Member level 1
Joined
Jul 20, 2012
Messages
117
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
DELHI, INDIA
Activity points
1,982
I have TCL script.

I have to change its variable for different IPs.

I want to change it from outside,not changing by going inside for every IP.

Like name of TCL file + some command to change its inside variable

e.g I have to change following

set TOP "timer"

here i have to chane next time "backbone"

So i want to change it ouside the file,from filename

Please Elaborate

Thanks
 

Hai amit,

use command line arguments in this case..

tclsh argv.tcl a b c


inside the code

set TOP "[lindex $argv 0]"

automatically value a is assigned to variable TOP thats it..
 
Hai amit,

use command line arguments in this case..

tclsh argv.tcl a b c


inside the code

set TOP "[lindex $argv 0]"

automatically value a is assigned to variable TOP thats it..

Hello friend I am using it in dc_shell(Design compiler)
where I am using the following command to execute

source main_dc.tcl

So can you tell me where i have to write the desired name like a,b,c

I had written like this

source main_dc.tcl a

but does not work.Is there any other to perform it.

please elaborate it,Thanks
 

Hai amit,

Here u are just sourcing..

u will call a tclsh code inside this right..

so mention in that place....

- - - Updated - - -

if u dont have tclsh code then

put the below command in terminal

setenv TOP "timer"

u can set outside without entering inside the program..

then run the program
 

Hai amit,

Here u are just sourcing..

u will call a tclsh code inside this right..

so mention in that place....

- - - Updated - - -

if u dont have tclsh code then

put the below command in terminal

setenv TOP "timer"

u can set outside without entering inside the program..

then run the program

But i want it to change at the place where I am sourcing.

Is it possible?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top