Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Pascal
result := false;
for e in list do 
	if e=x then
		begin
			result := true;
			break;
		end
p := list;
while (p <> nil) and (p^.key = x) do p := p^.next;
found := p.key = x
uses classes;
result := list.IndexOf(x) <> -1;

If list is a TStrings-descendant
with Ada.Containers.Vectors;
Result := List.Contains (X);

New implementation...