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!

Newbie Question

Status
Not open for further replies.

komyg

Programmer
Dec 13, 2005
68
0
0
BR
Ok, I don't know anything about tcl/tk and I'm having trouble with executing even the simplest code.
As I know C, I was expecting some kind of compiler to make the code into an executable, but I can't find one in tcl/tk. Does this means that if I just write:

puts "Hello World!"
exit 0

in the notepad and save it as test.tcl, it is supposed to work if I click it twice (so far it hasn't)? If not, how do I make it work?

Thanks,
Komyg
 
The first question is: have you installed TclTk?

It is true that Tcl is not a compiled language but it is interpreted (think GWBasic) and you need the interpreter to do this.

If you get the installation from ActiveState ( and run it, your PC should automatically associate .tcl files with the interpreter.

Now, let's say you did all that. In your example:
puts "Hello World!"
exit 0
you don't have anywhere to puts. Try this instead:
From your Start button, under Progams, go to the ActiveState group and choose the Tclsh[red]xx[/red] program. That will bring up a Tcl Shell.
At the prompt, type source <path if needed>test.tcl

Does that work?

_________________
Bob Rashkin
 
Yes, it's working perfectly. Thank you very much.

Komyg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top