Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Array-length/Tcl/array-length.tcl
Normal file
13
Task/Array-length/Tcl/array-length.tcl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
;# not recommended:
|
||||
set mylistA {apple orange} ;# actually a string
|
||||
set mylistA "Apple Orange" ;# same - this works only for simple cases
|
||||
|
||||
set lenA [llength $mylistA]
|
||||
puts "$mylistA : $lenA"
|
||||
|
||||
# better: to build a list, use 'list' and/or 'lappend':
|
||||
set mylistB [list apple orange "red wine" {green frog}]
|
||||
lappend mylistB "blue bird"
|
||||
|
||||
set lenB [llength $mylistB]
|
||||
puts "$mylistB : $lenB"
|
||||
Loading…
Add table
Add a link
Reference in a new issue