home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_03 / 2n03023a < prev    next >
Text File  |  1991-01-11  |  416b  |  24 lines

  1.  
  2.  
  3. const
  4.     ARRAY_MAX = 10;
  5. type
  6.     array_of_integer = array [1 .. ARRAY_MAX] of integer;
  7.  
  8. {*
  9.  * Compare two arrays of integers, a and b.  Return TRUE
  10.  * if for all i from 1 to n, a[i] = b[i]; return FALSE
  11.  * otherwise.
  12.  *}
  13. function equal(var a, b : array_of_integer; n : word)
  14.     : boolean;
  15.     var
  16.         i : word;
  17.     begin
  18.     i := 1;
  19.     while (i <= n) and (a[i] = b[i]) do
  20.         i := i + 1;
  21.     equal := i > n;
  22.     end;
  23.  
  24.