Search This Blog

TCL: array to list or list to array

  1. List to array:
    > array set a [list b 1 c 2 d 3]
    > puts $a(b)
    1
    > puts $a(c)
    2
    > puts $a(d)
    3
    
  2. Array to list:
    > puts [array get a]
    b 1 d 3 c 2
    

No comments:

Post a Comment