IF...ELSE control structure

Results 1 to 2 of 2

Thread: IF...ELSE control structure

  1. #1
    Join Date
    Dec 1969

    Default IF...ELSE control structure

    I have a simple question about control structures. I have three scenarios in a script and I dont want to use CASE 1, 2, 3, syntax unless I have to.<BR><BR>Currently, it looks something like:<BR>IF "scenario 1" THEN<BR> code<BR>IF "scenario 2" THEN<BR> code<BR>ELSE<BR> code<BR><BR>I am getting an "Expected statement" error right where the ELSE is in the code. How do I change the control structure syntax to evaluate all 3 scenarios before deciding which to pursue, and without giving me the error message? Is it IF, ELSE IF, ELSE? Remember that all three scenarios are at an equal level, none are nested within others.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: IF...ELSE control structure

    IF "scenario 1" THEN<BR> code<BR>ELSEIF "scenario 2" THEN<BR> code<BR>ELSE<BR> code<BR>END IF<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts