TCL/TK - Help Guys

Hi Folks,

I would like to know something abt TCL/TK. For those who dont know the expansion of it...here it goes TCL - Tool Command Language and TK - Tool Kit..

It can be used to write shell scripts, application programs using TCL and gui applns using TK.

For unix, we write tclsh shell scripts.. and also VTCL i.e., Visual TCL.

I want to know more abt TCL/TK. Some say that it is useful in System level programming in C.

Any help would be appreciated.

P.S. I dont know in which section should i post this thread whether in C programming or Unix Shell script.

Thanks,
Nisha

Tcl in C has syntax for grouping, which allows multiple words in one argument, and substitution, which is used with programming variables and nested command calls. The Tcl interpreter does grouping first, then substitutions, and finally it calls the command. It is up to the command to interpret its arguments

Ex Tcl in C:

Write command procedure in C: 
 int EqCmd(ClientData clientData, Tcl_Interp
        *interp, int argc, char **argv) {
    if (argc != 3) {
        interp->result = "wrong # args";
        return TCL_ERROR;
    }
    if (strcmp(argv[1], argv[2]) == 0) {
        interp->result = "1";
    } else {
        interp->result = "0";
    }
    return TCL_OK;
 }

Interfaces to C are simple, Tcl was designed to make this true &
the focus on primitives, which use Tcl scripts to compose fancy features. All the need is in between how you catchup with it.

Can we do System Level Programming in C with TCL/TK???

Thanks,
Nisha

:o

yes can. Try view this site for more information.

http://www.tcl.tk/doc/scripting.html

Hey thanks killerserv!!!

Looks like i will get more doubts once i get deep into it.

Can anyone send me a sample system level programming using C???

would be of a great help...

Thanks,
Nisha

:rolleyes: