Re: To Increase Speed of an application

"Felipe Rezek Mohallem" <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
HI, Daniel.
There was an error in your submited code!
If you don't assign nil to variable FRM1 (after showmodal), the function assigned ( FRM1 ) will return true and the form is already disposed. So the application would raise an exception.
Best regards,
Felipe

> procedure TFrmMain.frm1Click(Sender: TObject);
> var
>   I,j: Integer;
> begin
>   j:=0;
>   if ChkPlant() = false then
>    exit;
>   Screen.Cursor := crHourglass;
  {Checks to see if the FRM1 is not already created}
  if not assigned(FRM1) then
    {if FRM1 is not created, then create it}
    FRM1 := TFRM1.Create(Application);
>   FRM1.ShowModal ;
>   FRM1.free;
    FRM1 := nil;        // do not forget this
>   Screen.Cursor := crDefault;
> end;

______________________________________________________________
Felipe Rezek Mohallem
      1  http://www.rezek.com.br 
      + [email protected] 
      ( (31) 3375-8144 
     10802852   
   
______________________________________________________________

  ----- Original Message ----- 
  From: Daniel Rail 
  To: [email protected] 
  Sent: Thursday, July 31, 2003 5:06 PM
  Subject: Re: [Delphi] To Increase Speed of an application


  Hi,

  What about the changes below:

  > procedure TFrmMain.frm1Click(Sender: TObject);
  > var
  >   I,j: Integer;
  > begin
  >   j:=0;
  >   if ChkPlant() = false then
  >    exit;
  >   Screen.Cursor := crHourglass;
    {Checks to see if the FRM1 is not already created}
    if not assigned(FRM1) then
      {if FRM1 is not created, then create it}
      FRM1 := TFRM1.Create(Application);
  >   FRM1.ShowModal ;
  >   FRM1.free;
  >   Screen.Cursor := crDefault;
  > end;


  -- 
  Best regards,
  Daniel Rail
  Senior System Engineer
  ACCRA Group Inc. (www.accra.ca)
  ACCRA Med Software Inc. (www.filopto.com)


        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       

  CodeCoffer - new Delphi code protection Tool!
  http://www.delphicollection.com/public/CodeCoffer.htm
  ---------------------------------------------------------------
  Unsubscribe:[email protected]
  List owner:[email protected]
  --------------------------------------------------------------- 

  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.