SAIL (programming language): Difference between revisions

Content deleted Content added
Description: example
Line 16:
Standard statements included {{code|IF...THEN...ELSE}},{{sfn|Smith|1976|p=11}} {{code|FOR...STEP...UNTIL...DO}},{{sfn|Smith|1976|p=15}} {{code|WHILE...DO}} for top-tested loops, {{code|WHILE...UNTIL}} for bottom-tested, and {{code|GOTO}} which used a label.{{sfn|Smith|1976|p=17}} The {{code|CASE}} was similar to {{code|switch}} in C, but normally used a somewhat different syntax, like {{code|CASE i OF ("Zero","One","Two");}}, which returns the appropriate string based on the value of i.{{sfn|Smith|1976|p=11}} If one wanted to test explicit values in the CASE, the values had to be in square brackets:
 
<syntaxhighlight lang=Pascal>
<code>
CASE I OF
BEGIN
Line 23:
[6][7] 50
END;
</syntaxhighlight>
</code>
 
This code will ignore values like 1 to 3, and only return a value for the listed values. Note that the last item cannot have a semicolon following.{{sfn|Smith|1976|p=19}}