Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Undefined-values/Tcl/undefined-values.tcl
Normal file
24
Task/Undefined-values/Tcl/undefined-values.tcl
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Variables are undefined by default and do not need explicit declaration
|
||||
|
||||
# Check to see whether it is defined
|
||||
if {![info exists var]} {puts "var is undefind at first check"}
|
||||
|
||||
# Give it a value
|
||||
set var "Screwy Squirrel"
|
||||
|
||||
# Check to see whether it is defined
|
||||
if {![info exists var]} {puts "var is undefind at second check"}
|
||||
|
||||
# Remove its value
|
||||
unset var
|
||||
|
||||
# Check to see whether it is defined
|
||||
if {![info exists var]} {puts "var is undefind at third check"}
|
||||
|
||||
# Give it a value again
|
||||
set var 12345
|
||||
|
||||
# Check to see whether it is defined
|
||||
if {![info exists var]} {puts "var is undefind at fourth check"}
|
||||
|
||||
puts "Done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue