Posted to tcl by dgood` at Wed Aug 31 20:51:48 GMT 2011view raw

  1. if {$user_input eq ""} {
  2. set menu_level main
  3. } elseif {[scan $user_input {%s %s} cmd msg_id] != 2} {
  4. puts stdout "\nInvalid Input, try again.\n"
  5. } else {
  6. if {![string is wordchar -strict $cmd]} {
  7. puts stdout "\nInvalid Command_Name!\n"
  8. } elseif {![string is digit -strict $msg_id]} {
  9. puts stdout "\nInvalid Message_ID!\n"
  10. } else {
  11. simple_cmd $fh $msg_id $cmd
  12. }
  13. }
  14.