Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread stdreamer via fpc-pascal

On 10/3/2020 10:22 π.μ., Mattias Gaertner via fpc-pascal wrote:

On Tue, 10 Mar 2020 00:57:12 -0400
Anthony Walter via fpc-pascal  wrote:


[...]
What should happen is that both examples use the function from the
last unit in the uses clause.


Yes, that's how Pascal usually works and so it works in pas2js.
Strange that fpc does it the other way round.

Bug or feature?

No it does not. The first unit in the uses clause always take presents 
over the last. It always has it always should. Don't brake backwards 
compatibility.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New Warnings with fpc >= 3.2.0

2020-03-12 Thread stdreamer via fpc-pascal

On 11/3/2020 12:15 μ.μ., fredvs via fpc-pascal wrote:

Hello.

Compiling that code with fpc 3.2.0 gives the warning that follows:

--->  if (kind <> tabulatorkindty(-1)) --> gives now the warning:

"msedrawtext.pas(1115,48) Warning: range check error while evaluating
constants (-1 must be between 0 and 3)"

tabulatorkindty is declared as:

---> tabulatorkindty = (tak_left,tak_right,tak_centered,tak_decimal);

So, if I understand ok, with new feature of fpc, "-1" is no more permitted.

What must be changed, a new constant should be added at end of the array,
something like:

---> tabulatorkindty = (tak_left,tak_right,tak_centered,tak_decimal,
tak_none);

?

And then use:

--->  if (kind <> tabulatorkindty(tak_none) ?

Or do you have a other idea?

Thanks.

Fre;D




Do it the other way around ee
if (integer(kind) <> -1) then

which will make it always true. I see no reason for that "if" to exists 
at least not with out the code.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal