source: branches/lazarus/wowhosting.lpr.bak

Last change on this file was 61, checked in by george, 15 years ago
  • Přidáno: Další chybějící soubory s vývojové větve ve Free Pascalu.
File size: 1.3 KB
Line 
1program WowHosting;
2
3{$mode objfpc}{$H+}
4
5uses
6 {$IFDEF UNIX}{$IFDEF UseCThreads}
7 cthreads,
8 {$ENDIF}{$ENDIF}
9 Classes, SysUtils, CustApp
10 { you can add units after this };
11
12type
13
14 { wowhosting }
15
16 TWowHosting = class(TCustomApplication)
17 protected
18 procedure DoRun; override;
19 public
20 constructor Create(TheOwner: TComponent); override;
21 destructor Destroy; override;
22 procedure WriteHelp; virtual;
23 end;
24
25{ wowhosting }
26
27procedure TWowHosting.DoRun;
28var
29 ErrorMsg: String;
30begin
31 // Quick check parameters
32 ErrorMsg := CheckOptions('h', 'help');
33 if ErrorMsg <> '' then begin
34 ShowException(Exception.Create(ErrorMsg));
35 Terminate;
36 Exit;
37 end;
38
39 // parse parameters
40 if HasOption('h', 'help') then begin
41 WriteHelp;
42 Terminate;
43 Exit;
44 end;
45
46 { add your program here }
47
48 // stop program loop
49 Terminate;
50end;
51
52constructor TWowHosting.Create(TheOwner: TComponent);
53begin
54 inherited Create(TheOwner);
55 StopOnException := True;
56end;
57
58destructor TWowHosting.Destroy;
59begin
60 inherited Destroy;
61end;
62
63procedure TWowHosting.WriteHelp;
64begin
65 { add your help code here }
66 writeln('Usage: ', ExeName,' -h');
67end;
68
69var
70 Application: TWowHosting;
71
72{$IFDEF WINDOWS}{$R wowhosting.rc}{$ENDIF}
73
74begin
75 Application := TWowHosting.Create(nil);
76 Application.Title :='WoW hosting';
77 Application.Run;
78 Application.Free;
79end.
80
Note: See TracBrowser for help on using the repository browser.