Master TCL Programming in 24 hours by Mahajan Vishal

Master TCL Programming in 24 hours by Mahajan Vishal

Author:Mahajan, Vishal [Mahajan, Vishal]
Language: eng
Format: epub
Published: 2020-04-12T16:00:00+00:00


In the above example, scan command is used to scan the string str .

3.4 Lab 2

1) set set color1 "red green yellow"

2) set color2 [list red green yellow]

3) set color3 "red {green1 green2} yellow"

4) lindex $color1 0

5) lindex $color1 1

6) lindex $color1 end

7) lindex $color3 1

8) lappend color1 blue

9) lrange $color1 1 2

10) linsert $color1 2 "pink white"

11) lsort -unique $color1

12) lsearch -regexp $color1 .*een

13) set str TCL; split $str ""

14) set str "T C L"; join $str ""

3.5 Lab 2 Solutions

1) red green yellow

2) red green yellow

3) red {green1 green2} yellow

4) red

5) green

6) yellow

7) green1 green2

8) red green yellow blue

9) green yellow

10) red green {pink white} yellow blue

11) blue green red yellow

12) 1

13) T C L

14) TCL

3.6 dict

dict is a dictionary command. It is a key value pair mapping, Tcl uses a hash table to implement a dictionary.

Syntax

dict set dict_name key value



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.