Jethro commented on a Page, Number Game  -  Aug 26, 2010

Using goto with a bunch if conditions is deemed inefficient. You either use goto or if statements on its own sparingly. If I were you, I'd use goto in this fashion:

alias test {
  goto $iif(!$1,$null,$iif($1 = 2,yes,no))
  :no
  echo -a blah!
  halt
  :yes
  echo -a Aha!
  halt
  :error
  echo -a * You didn't specify a number 1 or something else!
  reseterror
}

You can put :yes or :no anywhere in the script. Goto jumps from point B to point A and vice versa.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.