[fpc-pascal] New Warnings with fpc >= 3.2.0
fredvs
fiens at hotmail.com
Wed Mar 11 12:51:34 CET 2020
> Do it properly, and add a tab_None or somesuch
If I may, I would prefer "somesuch" vs adding a new constant.
But, really, would it not possible to write the equivalent of
if (kind <> tabulatorkindty(-1)) then
Maybe using in this case:
if (kind = tabulatorkindty(tak_lef)) or (kind = tabulatorkindty(tak_right))
or (kind = tabulatorkindty(tak_centered)) or (kind =
tabulatorkindty(tak_decimal)) then
But I would prefer a shorter way, mainly if the array is big.
----------------------
Other question relative to Warnings:
How to do this:
tdataevent(de_afterapplyupdate)
where TDataEvent is defined as
TDataEvent = (deFieldChange, deRecordChange, deDataSetChange,
deDataSetScroll, deLayoutChange, deUpdateRecord, deUpdateState,
deCheckBrowseMode, dePropertyChange, deFieldListChange, deFocusControl,
deParentScroll,deConnectChange,deReconcileError,deDisabledStateChange);
and de_afterapplyupdate was defined with:
const
...
de_afterapplyupdate = ord(high(tdataevent))+6;
________________
Now:
---> tdataevent(de_afterapplyupdate)
Gives as Warning:
"msebufdataset.pas(4070,16) Warning: range check error while evaluating
constants (20 must be between 0 and 14)"
?
> It is a warning not an error.
Yes, but it shows that something is wrong and it is time now to fix this
before problems
Fre;D
-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
More information about the fpc-pascal
mailing list