TCL (Tool Command Language) Interview Questions and Answers

TCL (Tool Command Language) Questions and Answers:

1 :: Where can we find the sample tcl programs?

Please use below link to get the TCL tutor.

There are links to other online tutorials at
http://www.msen.com/~clif/Tcl.html
0/5 Rating (0 vote)
Is This Answer Correct?    1 Yes 0 No
Place Your Answer

2 :: Set ip address as 10.30.20.1 write a script to replace the 30 with 40?

here you can do this in multiple ways

1.regsub 30 $data 40 a
puts $a

this will give you the replaced string

2.string replace $data 3 4 40

this also will give you the replaced value
0/5 Rating (0 vote)
Is This Answer Correct?    1 Yes 0 No
Place Your Answer

3 :: How to check whether a string is palindrome or not using TCL script?

Code for the above pseudo code.Check if it works!!!!!

gets stdin a
set len [ string length $a ]
set n [ expr $len/2 ]

for { set i 0 } { $i < $n } { incr i 1 } {
set b [ string index $a $i ]
set c [ expr $len - 1 - $i ]
set d [ string index $a $c ]

if {$b != $d} {
puts "not a palindrome"
exit

}

}
puts "Palindrome"
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

4 :: How do you find the length of a string without using string length command in TCL?

set str "lenghtofthisstring"
set len 0
set list1 [ split $str "" ]
foreach value $list1 {
incr len
}
puts $len
0/5 Rating (0 vote)
Is This Answer Correct?    2 Yes 0 No
Place Your Answer

5 :: How to Swap 30 & 40 in IP address 192.30.40.1 using TCL script?

There are three solutions.

set a 192.30.40.1
set b [ string range $a 3 4 ]
set c [ string range $a 6 7 ]
set d [ string replace $a 3 4 $c ]
set e [ string replace $d 6 7 $b]
puts $e

===OR=====
set a 192.30.40.1
set b [ split $a .]
set u [lindex $b 0]
set v [lindex $b 3]
set x [lindex $b 1]
set y [lindex $b 2]
set z [join "$u $y $x $v" .]
puts $z

====OR====
set ip 192.30.40.1
regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $ip match 1st 2nd 3rd 4th
append new_ip $1st $3rd $2nd $4th
puts $new_ip
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

Rate This Category:
0/5 Rating (0 vote)
Place Your Question



Top: TCL (Tool Command Language) Interview Questions and Answers
TCL (Tool Command Language) Interview Questions and Answers

Top Frequently Asked TCL (Tool Command Language) Question
Frequently Asked TCL (Tool Command Language) Job Interview Question


Top Frequently opened Computer Programming Job Interview categories
Most popular Computer Programming Job Interview categories

Comments About TCL (Tool Command Language) Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about TCL (Tool Command Language) Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 23rd of May 2012

    Webmaster Said

    Tell us what you feel about TCL (Tool Command Language) Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on TCL (Tool Command Language) Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding TCL (Tool Command Language) Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: TCL (Tool Command Language) Interview Questions and Answers
Comments on TCL (Tool Command Language) Interview Questions and Answers

 
Top of Link batk to TCL (Tool Command Language) Interview Questions and Answers
Link batk to TCL (Tool Command Language) Interview Questions and Answers