Board index » delphi » Delphi 5 Ent- Windows 2000

Delphi 5 Ent- Windows 2000

Hello delphi's world,
 I have an ambiguos problem and i'm not able to understand the cause it
happens.
Take a look to the piece of code under here. I just make some
elaborations on a TList
object.  At every iteration, for time-consuming reason, i call the
ProcessMessage method
of the main Application object.

This code is the click event handler of a button on the MainForm.

I := 0;
   bEsciCiclo := False;
   While (I <= ListSchiera.Count - 1) and (Not bEsciCiclo) do
   begin
      ItemSchiera := ListSchiera.Items[I];
      if (ItemSchiera.dSched_DataOra <> dDataZero) or
        (ItemSchiera.dSched_Part - GL_Inizio_AK_H > Now) then
         bEsciCiclo := True
      else
      begin
         NextOperation(ItemSchiera); {Nel caso di anagrafica ho generato
AK ed EP}
         ListSchiera.Items[I] := Nil;
         ItemSchiera.Free;
      end;
      Inc(I);
      Application.ProcessMessages;
   end;
   ListSchiera.Pack;
   {Ordino la schiera}
   OrdinaSchiera;

The problem is:

     It doesn't come back after the call to  Application.ProcessMessages

so it doesn't do the Pack and Sort calls.
The same code on a  Windows NT 4 service pack 6 - Delphi 5 Ent. system
goes rigth.

    Thank you for paying attention

  Piero from Italy

--
Posted from tinet.it [193.207.147.222]
via Mailgate.ORG Server - http://www.Mailgate.ORG

 

Re:Delphi 5 Ent- Windows 2000


Quote
Samuele wrote:

> I := 0;
>    bEsciCiclo := False;
Try  <---
>    While (I <= ListSchiera.Count - 1) and (Not bEsciCiclo) do
>    begin
>       ItemSchiera := ListSchiera.Items[I];
>       if (ItemSchiera.dSched_DataOra <> dDataZero) or
>         (ItemSchiera.dSched_Part - GL_Inizio_AK_H > Now) then
>          bEsciCiclo := True
>       else
>       begin
>          NextOperation(ItemSchiera); {Nel caso di anagrafica ho generato AK ed EP}
>          ListSchiera.Items[I] := Nil;
>          ItemSchiera.Free;
>       end;
>       Inc(I);
>       Application.ProcessMessages;
>    end;
finally <---
>    ListSchiera.Pack;
>    {Ordino la schiera}
>    OrdinaSchiera;

end; <---

Quote
> The problem is:
>      It doesn't come back after the call to  Application.ProcessMessages

How about just using Try..Finally, as above, to ensure that your
Pack and Sort routines will be processed.

Markku Nevalainen

Other Threads