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

Problems with exec (file from within another file) 1

Status
Not open for further replies.

godatguitar

Programmer
May 8, 2003
33
0
0
GB
Hi

I need to open up a file from within another file.

I am doing the following:

if {$test == "1"} { exec Error.tcl}

Whats wrong, I know its exec, and I know that the file is located in the same directory as the current file, and I have tried various "/" or "\" etc...

Thanks

Paul
 
godatguitar,

After reading some of your posts it seems like you do
some things the hard way. I don't understand the necessity
of chaining tcl scripts together in the way you are doing
(like dos batch files??) when a library of proc {} can
handle errors as easily and in a modular way.
Take a look at the source command.

As to your problem: try {exec tclsh scriptname}.
 
Hi

Yeah, I know I seem to be doing things the hard way, but its because I am very new to this language and dont know any easier ways of doing things.

I have looked at my problem again and want to try creating a dialog box that will appear if the program has already been run before (ie, variable $test == 1)instead of running a tcl script from within another.
How do I do this?
I have tried BGERROR, but I need to configure the buttons on it to close all windows, but I do not think this is possible.

All I want is to open a dialog box if {$test == 1} thats says a message, and then a button that closes both the test window and the dialog box.

Any ideas?
Many thanks
 
Maybe something like this?
Code:
  toplevel .test
  ...
  set test [is_there_an_error?]
  if {$test}   {
    tk_messageBox -message [the_error_message]
    destroy .test
  }

HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top