[fpc-devel]Range check error?!
Tobias Hermann
tobih at mayn.de
Sat Jan 27 01:11:53 CET 2001
try to break up the line
build_edc:= EDC_crctable[(build_edc xor inout[i]) and $FF] xor
(build_edc shr 8);
into more single lines with single operations. use temporary variables... so
you can see where exactly the error occurs...
Then pse post again...
Tobi
----- Original Message -----
From: C.Keck <C.Keck at gmx.net>
To: <fpc-devel at lists.freepascal.org>
Sent: Saturday, January 27, 2001 12:36 AM
Subject: [fpc-devel]Range check error?!
> 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