Skip to content
Tcl Source Code History Of Ticket 2032614
Login

History Of Ticket 2032614

Artifacts Associated With Ticket 2032614

  1. Ticket change [e092ae6c7f] (rid 115220) by nobody on 2008-07-30 11:35:00:

    1. assignee initialized to: "davidw"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The first example at http://www.tcl.tk/man/tcl8.5/tutorial/Tcl8.html is missleading. I've build a similar case and got an unexpected result:
      
      set align 2;
      set center 2;
      set right 3;
      
      switch $align {
        $center {
          set align "center"; 
        } 
        $right {
          set align "right";
        } 
        default { 
          set align "left"; 
        }
      }
      
      dump $align;
      
      I expected to get "center" but I got "left". When modifying the example a bit to this it works as expected:
      
      set align 3;
      set center 2;
      set right 3;
      
      switch $align $center {
        set align "center"; 
      } $right {
       set align "right";
      } default { 
        set align "left"; 
      }
      
      dump $align;
      
      Main irritation for me as a TLC beginner was the use of variables inside the opening braket "{" which does not work and the newline after a closing braket for each case.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nobody"
    10. subsystem initialized to: "75. Tutorial"
    11. title initialized to: "Missleading "switch" example"
    12. type initialized to: "Bug"