Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

List

tcl

#!/usr/bin/tclsh

set myVariable {red green blue}
puts [lindex $myVariable 2]
set myVariable "red green blue"
puts [lindex $myVariable 1]

Multiple String

tcl

#!/usr/bin/tclsh

set myVariable "hello world"
puts $myVariable
set myVariable {hello world}
puts $myVariable

String Representation

tcl

#!/usr/bin/tclsh

set myVariable hello
puts $myVariable

Simple Example

tcl

#!/usr/bin/tclsh

set myVariable 18
puts [expr $myVariable + 6 + 9]

Simple Tcl Objects

tcl

#!/usr/bin/tclsh

set myVariable 18
puts $myVariable

backslash substitution

tcl

#!/usr/bin/tclsh

puts "Hello\nWorld"

variable substitution

tcl

#!/usr/bin/tclsh

set a 3
puts $a

Command Substitution

tcl

#!/usr/bin/tclsh

puts [expr 1 + 6 + 9]

Another Tcl Example

tcl

#!/usr/bin/tclsh

puts stdout "Hello, world!"

simple example

tcl

#!/usr/bin/tclsh

puts "Hello, world!"

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.