1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| #!/usr/bin/tclsh
#
# Demonstrate Data Structures
# using procedural wrappers
proc UserAdd { Acct rName eMail phone } {
global uData
if {[info exists uData($Acct,rname)]} {
return 1
}
set uData($Acct,rname) $rName
set uData($Acct,email) $eMail
set uData($Acct,phone) $phone
return 0
}
puts stdout [UserAdd bpb\
Brian bilbrey@junk.com 555-1212]
puts stdout [UserAdd tom\
Tom tom@junk.com 555-1212]
puts stdout [UserAdd bpb\
Brian bilbrey@junk.com 555-1212]
******
~/tcltk$ ./datas.tcl
0
0
1
|