A warning would be enough.
If after the INTO clause there are 2 or 3 variables, no problem, it will be
very easy to detect the mistake. But sometimes that is not the case because
there are 20+ variables and if variable 3 is called "lcName" and variable
24 is called "lcName" too, the programmer can
Doug,
> Delphi's latest compiler provides a hint in these cases:
>
> var
> x: Int32;
> begin
> try
> x := 0;
> x := 1;
> writeln(x);
> end.
>
> [dcc32 Hint] Project1.dpr(14): H2077 Value assigned to 'x' never used
> (Line 14 is the one assigning zero.)
In hindsight my post shoul
Some times,
I need to create a query where there is a 'where (0=0)' .
it´s not logic for anyone.
But to me, it´s significant because I need to certify that WHERE clausule
always exists when populate my query with dinamic filters controlled by my
application.
In your example, I can espaculate that
Interesting. (I haven't used Delphi for decades, certainly not this
century.)
On 09/02/2017 13:17, DougC d...@moosemail.net [firebird-support] wrote:
Delphi's latest compiler provides a hint in these cases:
var
x: Int32;
begin
try
x := 0;
x := 1;
writeln(x);
end.
[dcc32 Hint]
Delphi's latest compiler provides a hint in these cases:
var
x: Int32;
begin
try
x := 0;
x := 1;
writeln(x);
end.
[dcc32 Hint] Project1.dpr(14): H2077 Value assigned to 'x' never used
(Line 14 is the one assigning zero.)
On Thu, 09 Feb 2017 04:30:06 -0500 Tim W
Hmm - Delphi and Free Pascal do exactly that - they emit a warning, that
the first assigned value never gets used.
Am 09.02.2017 um 10:30 schrieb Tim Ward t...@telensa.com [firebird-support]:
>
>
> It' the equivalent in a conventional programming language of saying:
>
> x = a;
> x = b;
>
> where
It' the equivalent in a conventional programming language of saying:
x = a;
x = b;
where the compiler is expected to know that neither a not the first
assignment have any side effects other than the assignment (and where
the expression b doesn't depend on the value of x)(and where x isn't
vol
The error is of the programmer, I agree with you, but to repeat the name of
a variable without the Firebird showing any message of error is, at least
for me, a bug.
To have 2 or more variables with the same name after the INTO clause is
useless. The compiler can be smart enough to detect such thin
> Yes, but I can not know the value of the column X.ALU_NOMBRE
>
> And the idea, of course, is know that value, that's why it appears in the FOR
> SELECT. If not, I can do nothing with X.ALU_NOMBRE
You are asking for the system to evaluate the *intent* of logic.
That is completely outside the
Yes, but I can not know the value of the column X.ALU_NOMBRE
And the idea, of course, is know that value, that's why it appears in the
FOR SELECT. If not, I can do nothing with X.ALU_NOMBRE
Greetings.
Walter.
On Wed, Feb 8, 2017 at 12:02 PM, Dimitry Sibiryakov s...@ibphoenix.com
[firebird-sup
08.02.2017 16:55, 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com
[firebird-support] wrote:
> Of course, the fault is of the programmer, but it can be detected at
> compilation time.
Why? It is expanded into code like this:
FOR SELECT ALU_NOMBRE, ALU_APELLD AS CURSOR X DO
CREATE PROCEDURE TEST
RETURNS(
lcName VARCHAR(40))
AS
BEGIN
FOR SELECT
ALU_NOMBRE,
ALU_APELLD
FROM
ALUMNOS
INTO
:lcName,
:lcName
DO
SUSPEND;
END;
In the above stored procedure there are 2 columns in the FOR SELECT but
just 1 variable name.
It see
12 matches
Mail list logo