$eilif (Not Finished)

By Vegito on May 15, 2014

Same like nested $iif
$eilif(, , , <code for true, <code for false(optional)>)

Example: $eilif(1 > 2,hello,2 > 1,pretty,world) //returns pretty

Unfinished:
Logical Operators
passing variable as parameter

alias eilif {  
  if ($isid) {
    if ($0 !isnum 4-5) {
      echo insufficient parameters.
      echo Correct Syntax: $!eilif(<if condition>, <code for true>, <elseif condition>, <code for true, <code for false(optional)>)
    }    

    tokenize 32 $1-5
    if ($1 $2 $3) return $4
    elseif ($5 $6 $7) return $8
    else return $iif($9, $9, $false)
  }
}

Comments

Sign in to comment.
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.