Re: Two possible bugs (err... undocumented features) in Delphi 7.
From: Parmod (parmod_at_insyncspeech.com)
Date: 11/29/03
- Next message: Deepak Shenoy [TeamB]: "Re: Windows Shell Namespace Extensions"
- Previous message: Kevin: "Re: Check Different between 2 Files"
- In reply to: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Next in thread: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Reply: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 29 Nov 2003 01:14:54 -0500
"Kurt Barthelmess (TeamB)" <kbarthelmess@compuserve.com> wrote in message
news:3fc5e344.162072467@newsgroups.borland.com...
> "Parmod" <parmod@insyncspeech.com> wrote:
>
> >All the code pertinent to Iz is here.
>
> All the code pertinent to the references to Iz may be there, but
> that's not the question. The question is whether there is a path
> between the assignment statement at the beginning and the passing out
> of scope which does not involve a reference to the initial value
> assigned. Here is a modified example of your code to illustrate:
>
> procedure DoSomething;
> var
> I: Integer;
> Iz: Integer;
> begin
> Iz := 0;
> for I := 1 to 10 do
> begin
> Break;
> Inc(Iz);
> if Iz mod 100 = 0 then
> Beep;
> end;
> end;
>
> In this case, the code that references Iz never gets executed, and the
> compiler knows it. So a warning that the initial value is not used is
> appropriate.
>
> >This is the code I wrote to show
> >that mod is not considered use of the variable in this case.
>
> You have not shown that. In fact, if you take my example above, and
> remove the "Break;" line, you'll see that the warning disappears.
>
> You'll have to post a more complete example to illustrate the problem.
>
> Good luck.
>
> Kurt
>
My apologies. In fact the code was rather large so I put only excert here.
I found my bug. I never had the break line. However, I did have Ix, and
Iz. Instead of initializing Ix, I initialized Iz again within the loop. So
in effect the first Iz outside the loop was redundant and hence the error.
I have got to stop coding with my eyes closed. Thanks.
By the way, can you think of any reason why the second problem might occur.
..........
2) When a form is hidden, it does not seem to get FormCloseQuery event
fired consistently before closing in respose to Application.Terminate call
somewhere else in the code. This is also strage behavior, I believe.
.........
Is there any situation where FormCloseQuery would not be called when the
form is closing to a Application.Terminate in another form.?
- Next message: Deepak Shenoy [TeamB]: "Re: Windows Shell Namespace Extensions"
- Previous message: Kevin: "Re: Check Different between 2 Files"
- In reply to: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Next in thread: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Reply: Kurt Barthelmess: "Re: Two possible bugs (err... undocumented features) in Delphi 7."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|