[fpc-pascal] Range check error warning.

Alexander Grotewohl alex at dcclost.com
Tue Mar 24 17:32:33 CET 2020


just to be clear.. you did do foldhiddenbit: byte = 7, etc?

--
Alexander Grotewohl
https://dcclost.com

________________________________
From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> on behalf of fredvs via fpc-pascal <fpc-pascal at lists.freepascal.org>
Sent: Tuesday, March 24, 2020 12:22:10 PM
To: fpc-pascal at lists.freepascal.org <fpc-pascal at lists.freepascal.org>
Cc: fredvs <fiens at hotmail.com>
Subject: Re: [fpc-pascal] Range check error warning.

Hello WKitty.

   foldhiddenmask : byte = 1 shl foldhiddenbit;
   currentfoldhiddenmask : byte = 1 shl currentfoldhiddenbit;
   foldlevelmask : byte = not (foldhiddenmask or currentfoldhiddenmask);

  =

  msedatalist.pas(897,47) Error: (3203) Illegal expression
  msedatalist.pas(899,61) Error: (3203) Illegal expression
  msedatalist.pas(900,72) Error: (3203) Illegal expression


Thanks for the links for calculation, indeed the result is -193.

I did play with abs(), for example:

foldlevelmask = abs(byte(not (foldhiddenmask or currentfoldhiddenmask)));

But strangely still that warning:
Warning: (4110) Range check error while evaluating constants (-193 must be
between 0 and 255)

Fre;D


Fre;D





-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200324/10cb8eeb/attachment.html>


More information about the fpc-pascal mailing list