WHEN /../ END WHEN

A new Flow Control Statement  WHEN / OR WHEN / ELSE WHEN / END WHEN
when one Expression is true and ready with work, then it moves to END WHEN,
no other comparsion will be made.
Look in the generated Pascalsource to see what it does.

WHEN x=y THEN
  {your Code}
  {your Code}  ............ so many rows if you want
OR WHEN a=b THEN
  {your Code}
  {your Code}  ............ so many rows if you want   
OR WHEN c=d THEN
  {your Code}
  {your Code}  ............ so many rows if you want
ELSE WHEN    -----------------------------------------------when nothing other matches,
  {your Code}                                                  this will be done.
  {your Code}  ............ so many rows if you want
END WHEN


You can but must not use ELSE WHEN.
 

BASIC Source:

Pascal Source:

BEGIN
DIM x as Integer
DIM y as Integer
DIM z as Integer
DIM a as Integer

x = 10
y = 10
z = 5
a = 6

WHEN x < z THEN
    ? 'No Print'
OR WHEN x = y THEN
    ? 'Yes this would be printed'
OR WHEN z = 5 THEN
    ? 'No, the Loop would be breaked'
ELSE WHEN
    ? 'Not at this time'
END WHEN   
END.

 

 

 

 

 

x  :  Integer;
y  :  Integer;
z  :  Integer;
a  :  Integer;

BEGIN

x := 10;
y := 10;
z := 5;
a := 6;

Repeat
IF  x < z THEN
  Begin
      Writeln ( 'No Print');
  BREAK;
  END;
IF  x = y THEN
  BEGIN
      Writeln ( 'Yes this would be printed');
  BREAK;
  END;
IF  z = 5 THEN
  BEGIN
      Writeln ( 'No, the Loop would be breaked');
      BREAK
  END
ELSE
  BEGIN
      Writeln ( 'Not at this time');
  END;
UNTIL true;
END.

generates this: ^