Originally Posted By: starbucks_mafia

Code:
raw *:*:{
  goto $numeric {
    :001
    ;dostuff for numeric 001
    goto end
    :002
    ;dostuff for numeric 002
    goto end
    ;more numerics here!
    :error
    if (? /goto: * iswm $error) reseterror
    :end
  }
}


i like the extra { } to make it more legible laugh here's a simpler alternative to the error handling though, with a couple of small changes that seemed more intuitive to me:

Code:
raw *:*:{
  var %e = $event
  goto %e {
    :001
    ;dostuff for numeric 001
    return
    :002
    ;dostuff for numeric 002
    return
    ;more numerics here!
    :%e
  }
}


$event so it'll support non numeric ones too, just in case :X


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde