Professional Documents
Culture Documents
It is a scripting language
2. For executing the program firstly change the mode of the file by using the command:
Chmod +x filename.tcl ls (if the file name appears green this means the mode has been
changed)
3. The header file to be used in linux for executing the program is:
#!/usr/bin/tclsh (if we want to see the output on terminal)
#!/usr/bin/wish (if we want to see the output on gui)
tclsh : tcl shells
wish : windows shell
4. To create and open a program we use :
gedit filename.tcl
if the file already exists then it gets opened directly and if it is not present in the directory
then it gets created and is then opened.
5. To execute a file the command is:
./Filename.tcl
X
X
X
X
X
X
22. The switch and case statements are similar to if-else statement
23. Clear command is used to clear the terminal
24. To delete a file in linux we use the command: rm rfv filename
25. cat is the command that is used to read the file without opening the file
26. upvar is the command that is used for accessing the values and putting them in to new place
or variable
eg. upvar$aa_
27. there are two types of calling a value inside a program i.e.
a. call by copy
b. call by reference
in call by copy the copy of a value is called and in case we change the value than the
original value does not get affected i.e. the original value remains same
in call by reference the actual value is called from its original location and if we in case
change the value than the original value also gets changed
28. textvar is a variable that should be declared globally to get the value
29. if we declare a variable as global then we can access it anywhere inside the program
30. to generate a label inside a tcl program the command is :
label.label_name
31. to create a button the command is :
button.button_name textvariable-text..-commandprocedure_name
32. to see the combines gui consisting of buttons and labels the command is:
pack.label_name.button_name
33. to pass multiple arguments the command is:
proc multi_add{args}
34. we define the procedure as: proc procedure_name
35. to display the message box tk provides a direct command i.e. tk_messageBox title
messgae .. type. icon..]
36. underline charPosition command is used to select the position of the hot key
37. -tearoff allows a menu to be removed from the menubutton and displays it in a permanent
window.
38. Toggle key word is used to toggle any check box selection
39. The command used to hide or reduce is : forget
40. To insert a frame the command is:
Frame.f borderwidth width background color
41. -orient command is used to set the orientation
a. h horizontal
b. v vertical
42. there are different writing styles like bold, groove, flat
43. to create a radio button there is a direct command i.e. radiobutton
44. to create a list box there is a direct command i.e. listbox
45. for the cursor selection the command is curselection
46. tk_choosedirectory command to capture indices
47. tk_choosecolor to open the color palette
48. The command used to set the font of the text is: -fontansi 12 bold
49. Nested procedure: a procedure inside another procedure that is called automatically
50. To input a button inside a top level the command is: button.top.but