Changeset 286 for branches/web/UCore.pas


Ignore:
Timestamp:
Sep 8, 2010, 10:08:43 AM (14 years ago)
Author:
george
Message:
  • Odstraněno: Nadále nebude používána sada knihoven powutils.
  • Přidáno: Vlastní třída pro obsluhu a podporu zpracování CGI programů.
  • Upraveno: Korekce názvů sloupců a tabulek databáze.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/web/UCore.pas

    r279 r286  
    2121function PagesList(URL: string; Page, TotalCount, CountPerPage: Integer): string;
    2222function StrRepeat(Data: string; Count: Integer): string;
    23 function FormatOutput(Data: string): string;
    24  
     23
    2524type
    2625  TRegistredPage = record
     
    177176end;
    178177
    179 function FormatOutput(Data: string): string;
    180 var
    181   BlockStart, BlockEnd: Integer;
    182   Indention: Integer;
    183   Indention2: Integer;
    184   Line: string;
    185   Command: string;
    186 begin
    187   Result := '';
    188   Indention := 0;
    189   Indention2 := 0;
    190   while Data <> '' do begin
    191     //WebWrite('.');
    192     BlockStart := Pos('<', Data);
    193         BlockEnd := Pos('>', Data);
    194     if BlockStart > 1 then begin
    195           BlockEnd := BlockStart - 1;
    196           BlockStart := 1;
    197         end;
    198         Line := Trim(Copy(Data, BlockStart, BlockEnd));
    199         //WebWriteLn(Line);
    200         if Length(Line) > 0 then
    201           if Line[1] = '<' then begin
    202             if Data[BlockStart + 1] = '/' then begin
    203               Indention := Indention - 2;
    204               Indention2 := Indention;
    205             end else begin
    206           if Pos(' ', Line) > 0 then Command := Copy(Line, 2, Pos(' ', Line) - 2)
    207                 else Command := Copy(Line, 2, Length(Line) - 2);
    208                   //WebWriteLn(Command + ' ' + IntToStr(Indention));
    209           if Pos('</' + Command + '>', Data) > 0 then Indention := Indention + 2;
    210                   //WebWriteLn(IntToStr(Indention) + ',' + IntToStr(Indention2));
    211             end;   
    212           end;
    213           if Line <> '' then Result := Result + StrRepeat(' ', Indention2) + Line + #13#10;
    214           Data := Copy(Data, BlockEnd + 1, Length(Data));
    215           Indention2 := Indention;
    216   end;
    217 end;
    218178
    219179initialization
Note: See TracChangeset for help on using the changeset viewer.