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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL File Eval syntax from a C++

Status
Not open for further replies.

mbitzko

Programmer
Apr 5, 2005
13
0
0
US
I have a main C++ program which interfaces to TCL. I can source a TCL file so long as it has an explicit file path which works well:

Tcl_EvalFile( interp, "c:/Software/emPackage.tcl" );

However, when I try to make it a little more location independent, it fails to locate the file


Tcl_EvalFile( interp, "[file join [file dirname [info script]] emPackage.tcl]" );


What is the best way to make a software package location independ, since users may install it in a variety of different locations?

 
If I get you right you want to create the file name at runtime and pass it to the Tcl_EvalFile function. It seems you think that the string passed to this function is evaluated by the interpreter. AFAIK this is not true, instead the string is processed as it is.
So you have to do the file name construction stuff in C/C++ as well.

Was that it?

Greetings,
Tobi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top