At this time it is only one Syntax of IF / THEN / ELSE / (ELSES) / END IF allowed:IF x=y THEN {your Code}END IFandIF x=y THEN {your Code} {your Code} ............ so many rows if you wantELSE {your Code} {your Code} ............ so many rows if you wantEND IFIF x=y THEN {your Code} {your Code} ............ so many rows if you wantELSES {your Code} ............ only one row and no END IFWhen you forgot the THEN, BasPas put them on the end for you.
BASIC Source:
Pascal Source:
BEGINDIM x as IntegerDIM y as IntegerDIM z as IntegerDIM a as Integerx = 10y = 10z = 5a = 6IF (x = y) and (z < a) THEN a = z + y ? a
ELSE ? 'This would never be written!'END IFEND.
x : Integer;y : Integer;z : Integer;a : Integer;BEGINx := 10;y := 10;z := 5;a := 6;IF (x = y) and (z < a) THEN BEGIN a := z + y; Writeln ( a);
ELSE BEGIN Writeln ( 'This would never be written!'); END; END;END.
generates this: ^