Jump to content

Search a list: Difference between revisions

m
m (→‎[[#ALGOL 68]]: add FOR loop version with no exception)
Line 56:
===Using a FORMAT "value error" exception===
FORMAT hay stack := $c("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo")$;
[]STRING needles = ("Washington","Bush");
FILE needle exception; STRING ref needle;
Line 69 ⟶ 67:
);
[]STRING needles = ("Washington","Bush");
FOR i TO UPB needles DO
STRING needle := needles[i];
Line 83 ⟶ 82:
5 Bush
</pre>
 
===Using a manual FOR loop with no exception===
[]STRING hay stack = ("Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo");
Cookies help us deliver our services. By using our services, you agree to our use of cookies.