The Tower of Babel

Function occurs

function occurs (
    pattern : array[1..10000] of char,
    pat_length : integer,
    text : array[1..10000] of char,
    where : integer) : Boolean;

var
  index : integer;
begin
  occurs := true;
  index := 1;
  while (index <= pat_length) and occurs do
    begin
      if pattern[index] <> text[where+index-1] then
         occurs := false;
      index := index + 1
    end;
end

What are the formal parameters? What is the type of the returned value?

[TOC][Next]


CS1104 Main Page
Last Updated 01/05/2000
© L.Heath, 2000