[fpc-devel]Range check error?!

C.Keck C.Keck at gmx.net
Sat Jan 27 00:36:37 CET 2001


Hi,

I have some problems with a little CRC-calculation routine I ported from some C code.
The FPC version gives a range check error, but I can't find the reason for this...
Here's the source:

function build_edc (var inout : array of byte; from, upto : integer) : longint;

var i : integer;

begin
  build_edc:= 0;
  for i:= from to upto-1 do
    build_edc:= EDC_crctable[(build_edc xor inout[i]) and $FF] xor (build_edc shr 8);
end;

FYI: EDC_crctable[] is an array with longint values

Could somebody please help me?
Many thanks in advance!

C.Keck






More information about the fpc-devel mailing list