Changeset 24 for branches/lazarus/index.pas
- Timestamp:
- Sep 8, 2010, 4:17:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/lazarus/index.pas
r23 r24 4 4 5 5 uses 6 UCore, USqlDatabase, SysUtils, 7 UCGIApplication, UStringListEx; 8 9 type 10 11 { TMyCGIApplication } 12 13 TMyCGIApplication = class(TCGIApplication) 14 procedure Execute; override; 15 end; 6 UCore, USqlDatabase, SysUtils, Contnrs, 7 UCGIApplication, UStringListEx, UMainPage, UCustomCGIApplication; 16 8 17 9 var 18 Application: TMyCGIApplication; 19 20 { TMyCGIApplication } 21 22 procedure TMyCGIApplication.Execute; 23 var 24 I: Integer; 25 PageName: string; 26 begin 27 Output.Add('Hello friend'); 28 SysInfo; 29 30 PageName := Query.Values['p']; 31 if PageName = '' then PageName := 'index'; 32 I := 0; 33 while (I < Length(Pages)) and (Pages[I].Name <> PageName) do Inc(I); 34 if I < Length(Pages) then Output.Add(Pages[I].Producer) 35 else Output.Add('Stránka nenalezena'); 36 end; 10 Application: TCustomCGIApplication; 37 11 38 12 begin 39 Application := TMyCGIApplication.Create; 40 Application.Run; 41 Application.Free; 13 Application := TCustomCGIApplication.Create; 14 with Application do 15 try 16 RegisterPage('index', MainPage); 17 Run; 18 finally 19 Free; 20 end; 42 21 end.
Note:
See TracChangeset
for help on using the changeset viewer.