This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

need some tcl help plz

Old posts that have not been replied to for several years.
Locked
b
b34r
Voice
Posts: 35
Joined: Wed Jun 18, 2003 4:09 pm

need some tcl help plz

Post by b34r »

Hi
well i finally made my very first tcl script
it's a swedish tv-program fetcher :D
The only thing i'm not able to finalize is how do i check the input, like

Code: Select all

!teve discovery
so that i wont get any errors if somebody types anything else instead of the channels or help text that is allowed.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

use something like this:

Code: Select all

switch -- [strlwr [lindex $text 0]] {
  "discovery" {
    # something for the discovery channel
  }
  "animalplanet" {
    # somkething here for the animal planet..
  }
  # and so on.
  default {
    # insert here something for the channels you don't have
    # if the channels dosen't exist this will be called.
  }
}
Once the game is over, the king and the pawn go back in the same box.
Locked