[fpc-pascal] Range check error warning.
Sven Barth
pascaldragon at googlemail.com
Wed Mar 25 19:17:37 CET 2020
<wkitty42 at windstream.net> schrieb am Mi., 25. März 2020, 18:47:
> On 3/24/20 6:58 PM, Sven Barth via fpc-pascal wrote:
> > wkitty42 at windstream.net schrieb am Di., 24. März 2020, 18:37:
> >
> >> you should figure out why typed constants are not being allowed/used
> >> in your setup...
> >
> > Typed constants can not be used to initialize constants.
>
>
> hummm... ok, so how to you get a constant to be a byte and storing 7 for
> the
> decimal value?
>
The compiler normally uses the smallest possible type that can represent
the value. You can force it however by using e.g.
const
MyConst = Word(42);
> or are you saying that you cannot use a typed constant in the init of
> another
> (typed) constant?
>
Correct.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200325/53587268/attachment.html>
More information about the fpc-pascal
mailing list