Welcome to the new Sahi Forums!
Nested else-if statements?
  • 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");
    }
    }
  • 2 Comments sorted by
  • Vote Up0Vote Down umashankarqaumashankarqa
    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
  • It worked! Thanks!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter