whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

13 Visitors Online


 
...limit a programs execution time?
Autor: Helmut Elsner
Homepage: http://communities.msn.de/HelmutElsner
[ Print tip ]  

Tip Rating (7):  
     


{
  In der Projekt Datei (.dpr):
  In your project's file (.dpr):
}

uses
  
Forms, Sysutils, Dialogs,
  MyProgr in my_prog1.pas {Form1};

const
  
email = 'my.mail@provider.xyz';
  homepage = 'http://www.myhomepage.com';

  // Limit the execution time to 04/21/2003.
  // Gültigkeit auf 21. April 2003 begrenzen.

  
YearExp = 2003;
  MonthExp = 4;
  DayExp = 21;

function CheckDate(y, m, d: Integer): Boolean;
begin
  
Result := True;
  if (Date > EncodeDate(y, m, d)) then
  begin
    
ShowMessage('End of usage exceeded. Download a new'+
                 'version at' + ^j + homepage+ ^j + ' or contact: ' + email);
  Result := False;
  // halt;
end;

end;


{$R *.RES}

begin
  if 
CheckDate(YearExp, MonthExp, DayExp) then
  begin
    
Application.Initialize;
    Application.Title := 'Some Title';
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  end;

end.


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners