desarrollosconsejeria/aulalinex-ltsp-server/4.2-2/serveraulalinexltsp/serveraulalinexltsp.lpr @ 23a384b9
23a384b9 | Elisa | program serveraulalinexltsp;
|
|
{$mode objfpc}{$H+}
|
|||
uses
|
|||
cthreads,
|
|||
Classes, SysUtils, CustApp
|
|||
{ you can add units after this }, globales, demonio, clservidor,
|
|||
clcomandosroot;
|
|||
type
|
|||
{ TMyApplication }
|
|||
TMyApplication = class(TCustomApplication)
|
|||
protected
|
|||
procedure DoRun; override;
|
|||
public
|
|||
constructor Create(TheOwner: TComponent); override;
|
|||
destructor Destroy; override;
|
|||
procedure WriteHelp; virtual;
|
|||
end;
|
|||
{ TMyApplication }
|
|||
procedure TMyApplication.DoRun;
|
|||
var
|
|||
ErrorMsg: String;
|
|||
begin
|
|||
// quick check parameters
|
|||
ErrorMsg:=CheckOptions('h','help');
|
|||
if ErrorMsg<>'' then begin
|
|||
ShowException(Exception.Create(ErrorMsg));
|
|||
Halt;
|
|||
end;
|
|||
// parse parameters
|
|||
if HasOption('h','help') then begin
|
|||
WriteHelp;
|
|||
Halt;
|
|||
end;
|
|||
{ add your program here }
|
|||
sleep(50);
|
|||
// stop program loop
|
|||
//Terminate;
|
|||
end;
|
|||
constructor TMyApplication.Create(TheOwner: TComponent);
|
|||
begin
|
|||
inherited Create(TheOwner);
|
|||
StopOnException:=True;
|
|||
end;
|
|||
destructor TMyApplication.Destroy;
|
|||
begin
|
|||
inherited Destroy;
|
|||
end;
|
|||
procedure TMyApplication.WriteHelp;
|
|||
begin
|
|||
{ add your help code here }
|
|||
writeln('Usage: ',ExeName,' -h');
|
|||
end;
|
|||
var
|
|||
Application: TMyApplication;
|
|||
{$IFDEF WINDOWS}{$R serveraulalinex.rc}{$ENDIF}
|
|||
begin
|
|||
Application:=TMyApplication.Create(nil);
|
|||
Application.Run;
|
|||
Application.Free;
|
|||
end.
|