Conditional structures: Difference between revisions

Content added Content deleted
(→‎{{header|Simula}}: Section added)
Line 4,121: Line 4,121:
'''if''' X=Y '''then''' K:=I
'''if''' X=Y '''then''' K:=I
An example:
An example:
<lang simula>
<lang simula>BEGIN
BEGIN
INTEGER i,j;
INTEGER i,j;
i:=1; j:=2;
i:=1; j:=2;
Line 4,140: Line 4,139:
END;
END;
OutImage
OutImage
END
END</lang>
Simula 67 has also a switch structure:
</lang>
Simula 67 has also a switch structure.
declaration::= '''switch''' switch:=list_of labels
declaration::= '''switch''' switch:=list_of labels
statement::= '''goto''' switch[expression]
statement::= '''goto''' switch[expression]
An example:
An example:
<lang simula>
<lang simula>BEGIN
BEGIN
INTEGER i,j;
INTEGER i,j;
SWITCH target:=L1,L2,L3;
SWITCH target:=L1,L2,L3;
Line 4,157: Line 4,154:
L3: OutText("CC");
L3: OutText("CC");
OutImage
OutImage
END
END</lang>
</lang>



=={{header|Slate}}==
=={{header|Slate}}==