Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Nested else-if statements?

edited April 2013 in Sahi - Open Source
Hi, what is the syntax for if-else-if statements in Sahi script? The following failed with a syntax error:

function caseSwitch($htype){
if($htype==22){
type22();
}
else
{if($htype==5){
type5();
}
}
else
{
_log("Whoops, Hierarchy Type " + $htype + " has not been automated yet");
}
}

Comments

  • Members Accepted Answer
    Hi kyoob,

    Please try with the below code,

    function caseSwitch($htype)
    {

    if($htype==22)
    {
    type22();
    }

    else if($htype==5)
    {
    type5();
    }

    else
    {
    _log("Whoops, Hierarchy Type " + $htype + " has not been automated yet");
    }

    }

    Good Luck !!

    -Umashankar
  • Members
    It worked! Thanks!
Sign In or Register to comment.