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!

How to set a variable in script for a c++ file variable

Status
Not open for further replies.

nagaraju516

Programmer
Nov 13, 2005
1
US
Hello frnds, I joined today in this group.
I am working in Expect. I am writing one script which I want to set a variable value in c++ file. But I am getting error "Namespace doesn't found".

Please anyone can help me in this regard.

Regards,
Nagaraju
 
Hi,

a little more information would likely help solve your problem.

But I guess you want to link a TCL variable to a variable in your c++ program. So whenever you change the TCL var (using set, ...) the c++ var will be updated accordingly. All you have to do is call Tcl_LinkVar(interp, varName, addr, type) in your c++ code.
Parameter type: Must be one of TCL_LINK_INT, TCL_LINK_DOUBLE, TCL_LINK_WIDE_INT, TCL_LINK_BOOLEAN, or TCL_LINK_STRING, optionally OR'ed with TCL_LINK_READ_ONLY to make Tcl variable read-only.

Cheers,
LF28
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top