Re: Two possible bugs (err... undocumented features) in Delphi 7.

From: Parmod (parmod_at_insyncspeech.com)
Date: 11/29/03


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.?



Relevant Pages

  • Documents referencing a ~tmp file ?
    ... I have several hundred documents that were created using a VBA ... Occasionally when closing of the documents based on the template, ... How can I remove the references for ALL documents and replace them ...
    (microsoft.public.word.vba.general)
  • Re: SW2008 Opening Random Files In Background
    ... and I'm wasting half of my day closing them all the ... referenced documents" to none. ... not open documents that have references in the offending assemblies. ...
    (comp.cad.solidworks)
  • Re: How to kill a form
    ... Form references are different from other references. ... LPARAMETERS oForm ... The remaining reference is in the calling proc. ... does not show anything that should stop the form from closing. ...
    (microsoft.public.fox.programmer.exchange)
  • RE: Documents referencing a ~tmp file ?
    ... You may have objects that are created by code in the template but are not ... > Occasionally when closing of the documents based on the template, ... > by an open VBA project. ... You should close the project that references ...
    (microsoft.public.word.vba.general)