Tuesday, 7 February 2017

Switch command in tcl-tk

Check it @ Coding Ground





puts "Enter the menu item number to show the information about the person.\n Any other number will quit the application:"



puts -nonewline "1- Dr.\n2- Gurinder\n3- Pal\n4- Singh:"



gets stdin select



while { $select <=6 && $select>=1 } {

     switch $select {

              1 { puts "Gurinder pal SIngh is your teacher!\n"}

              2 { puts "In tcl-tk class.\n"}

              3 { puts "8th semester ECE\n"}

              4 { puts "4 lectures a week \n"}

               default { puts "tcl-tk for vsli tool automation"}

}

       puts "Select another person:"

       gets stdin select

 }

   puts "End of program."

No comments:

Post a Comment